Installation

Installation

This guide will walk you through setting up the Garden framework.

Please follow the guide for your operating system:

And if you decide to use Minikube, please see our Minikube Instructions further down in this document.

macOS

For Mac, we recommend the following steps to install Garden. You can also follow the manual installation steps below if you prefer.

Step 1: Install Homebrew

If you haven't already set up Homebrew, please follow their installation instructions.

Step 2: Docker and local Kubernetes

To install Docker, Kubernetes and kubectl, we strongly recommend Docker for Mac. Garden itself doesn't require a local installation of Kubernetes, but it is in most cases the preferred way of using it.

Note: If you have an older version installed, you may need to update it in order to enable Kubernetes support.

Once installed, open Docker for Mac's preferences, go to the Kubernetes section, tick Enable Kubernetes and save. Please refer to their installation guide for details.

Alternatively, you can use Minikube. We generally find it less stable and more hassle to configure and use, but we do fully support it on Mac. Please look at the Minikube Instructions section for details.

Step 3: Install garden-cli

We have a Homebrew tap and package that you can use to easily install garden-cli and its dependencies:

brew tap garden-io/garden
brew install garden-cli

To later upgrade to the newest version, simply run brew update and then brew upgrade garden-cli.

Windows

You can run Garden on Windows 10 Pro or Enterprise editions (the Home edition unfortunately does not work because it does not include support for virtualization).

To install the Garden CLI and its dependencies, please use our installation script. To run the script, open PowerShell as an administrator and run:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/garden-io/garden/master/support/install.ps1'))

The things the script will check for are the following:

  • The Chocolatey package manager. The script installs it automatically if necessary.

  • git, rsync and Docker for Windows. The script will install or upgrade those via Chocolatey.

  • Whether you have Hyper-V enabled. This is required for Docker for Windows. If you do not already have it enabled,

    the script will enable it, but you will need to restart your computer before starting Docker for Windows.

  • Whether you have Kubernetes enabled in your Docker for Windows installation.

To later upgrade to the newest version, simply re-run the above script.

Linux (manual installation)

You need the following dependencies on your local machine to use Garden:

  • Docker

  • Git

  • rsync

  • (in most cases) A local installation of Kubernetes and kubectl

Step 1: Docker

To install Docker, please follow the instructions in the official documentation.

Step 2: Local Kubernetes

For local Kubernetes, you can use Minikube. Please see the Minikube section below for details.

Step 3: Install other dependencies

Use your preferred method or package manager to install git and rsync. On Ubuntu, that's sudo apt install git rsync.

Step 4: Install garden-cli

Once you have the dependencies set up, download the Garden CLI for your platform from our latest release page, extract and make sure it is on your PATH. E.g. by extracting to ~/.garden/bin and adding export PATH=$PATH:~/.garden/bin to your .bashrc or .zshrc file.

MicroK8s

Garden can be used with MicroK8s on supported Linux platforms.

To install it, please follow their instructions.

Once installed, note that you need to make sure Garden can access the cluster by either aliasing microk8s.kubectl to kubectl:

alias kubectl='microk8s.kubectl'

Or if you already have kubectl installed (or wish to install it separately), you need to add the microk8s configuration to your ~/.kube/config so that Garden knows how to access your cluster. We recommend exporting the config like this:

microk8s.kubectl config view --raw > $HOME/.kube/microk8s.config

And then adding this to your .bashrc/.zshrc:

export KUBECONFIG=${KUBECONFIG:-$HOME/.kube/config}:$HOME/.kube/microk8s.config

Minikube

Garden can be used with Minikube on supported platforms.

NOTE: We highly recommend using Docker for Mac and Docker for Windows, on macOS and Windows respectively.

Installing Minikube

For Minikube installation instructions, please see the official guide.

You'll likely also need to install a driver to run the Minikube VM. Please follow the instructions here and note the name of the driver you use. The driver you choose will likely vary depending on your OS/platform. We recommend hyperkit for macOS and kvm2 on most Linux distributions.

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

You'll also need to have Docker (for macOS, we recommend Docker for Mac) and kubectl installed.

Usage

The local-kubernetes plugin attempts to automatically detect if it 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-kubernetes plugin by default, but you can configure it explicitly in your project-level garden.yml as follows:

kind: Project
environments:
- name: local
providers:
- name: local-kubernetes
context: minikube

If you happen to have installed both Minikube and a version of Docker for Mac with Kubernetes support enabled, garden will choose whichever one is configured as the current context in your kubectl configuration. If neither is set as the current context, the first available context is used.

(If you're not yet familiar with Garden configuration files, see: Configuration files)

Anything else?

Once the above is set up, the local-kubernetes plugin will automatically configure everything else Garden needs to work. The built-in nginx ingress controller will be automatically enabled and used to route requests to services.