Garden works great with local Kubernetes "clusters". Below you'll find requirements, installation and usage instructions for some common flavors of local Kubernetes setups, such as Minikube, Docker for Desktop and MicroK8s.
Garden is committed to supporting the latest six stable versions of Kubernetes (i.e. if the latest stable version is v1.17.x, Garden supports v1.12.x and newer).
The officially supported variants of local Kubernetes are the latest stable versions of
Other distributions may also work, but are not routinely tested or explicitly supported. Please don't hesitate to file issues, PRs or requests for your distribution of choice!
For any variant that runs in a VM on your machine (such as Docker Desktop and Minikube), we recommend tuning the size of the VM (in terms of CPU and RAM) to your needs, which will vary by the weight of the project(s) you're running.
Note: If you have an older version installed, you may need to update it in order to enable Kubernetes support.
Once installed, open Docker Desktop's preferences, go to the Kubernetes section, tick
Enable Kubernetesand save.
Once installed, you need to add the
microk8sconfiguration to your
~/.kube/configso that Garden knows how to access your cluster. We recommend exporting the config like this:
microk8s config > $HOME/.kube/microk8s.config
And then adding this to your
You also need to ensure microk8s commands can be run by the user that's running Garden, so that Garden can get its status and enable required extensions if necessary. To do this, add your user to the
sudo usermod -a -G microk8s $USER # or replace $USER with the desired user, if it's not the current user
Note that in-cluster building is currently not supported with microk8s clusters.
Once Minikube and the appropriate driver for your OS are installed, you can start Minikube by running:
minikube start --vm-driver=<your vm driver> # e.g. hyperkit on macOS
cat <<EOF | kind create cluster --config=-
- role: control-plane
- containerPort: 80
- containerPort: 443
Alternatively, if you don't need an ingress controller, you can set
setupIngressController: nullin your
local-kubernetesprovider configuration and start the cluster without the above customization.
Note that in-cluster building is currently not supported with kind clusters.
local-kubernetesplugin attempts to automatically detect which flavor of local Kubernetes is installed, and set the appropriate context for connecting to the local Kubernetes instance. In most cases you should not have to update your
garden.yml, since it uses the
local-kubernetesplugin by default, but you can configure it explicitly in your project-level
- name: local
- name: local-kubernetes
If you happen to have installed both Minikube and a version of Docker for Mac with Kubernetes support enabled,
gardenwill choose whichever one is configured as the current context in your
kubectlconfiguration. If neither is set as the current context, the first available context is used.