This guide will walk you through setting up the Garden framework. It assumes you already have Garden installed. If you don't, please check out our installation guide.
Note: Check if Kubernetes is running with
kubectl version. You should see both a
Client Version and a
Server Version in the response. If not, please start it up before proceeding.
Clone the repo and change into the
git clone https://github.com/garden-io/garden.gitcd garden/examples/simple-project
First, let's check the environment status by running the following from the project root:
garden get status
The response tells us how the environment is configured and the status of the providers. Next, we'll build our modules with:
This builds Docker images for
node-service respectively. Next, we'll deploy the services with:
And that's it! The
garden build step above is actually unnecessary (only included here for clarity), since
garden deploy will also rebuild modules as needed. The services are now running on the Garden framework. You can see for yourself by querying the
/hello endpoint of
go-service's running container:
garden call go-service/hello-go
To run tests for all modules:
And if you prefer an all-in-one command that watches your project for changes and re-builds, re-deploys, and re-tests automatically, try:
Go ahead, leave it running and change one of the files in the project, then watch it re-build.
That's it for now. Check out our Using Garden section for other features like hot reload, remote clusters, integration tests, and lots more.
To see how a Garden project is configured from scratch check, out the Simple Project guide for a more in-depth presentation.