2018-08-18 05:08:03 +00:00
|
|
|
# Consul Helm Chart
|
|
|
|
|
|
|
|
This repository contains the official HashiCorp Helm chart for installing
|
|
|
|
and configuring Consul on Kubernetes. This chart supports multiple use
|
|
|
|
cases of Consul on Kubernetes depending on the values provided.
|
|
|
|
|
2018-09-10 16:38:27 +00:00
|
|
|
For full documentation on this Helm chart along with all the ways you can
|
|
|
|
use Consul with Kubernetes, please see the
|
|
|
|
[Consul and Kubernetes documentation](https://www.consul.io/docs/platform/k8s/index.html).
|
2018-08-18 05:27:43 +00:00
|
|
|
|
2018-08-18 05:08:03 +00:00
|
|
|
## Prerequisites
|
|
|
|
|
|
|
|
To use the charts here, [Helm](https://helm.sh/) must be installed in your
|
|
|
|
Kubernetes cluster. Setting up Kubernetes and Helm and is outside the scope
|
|
|
|
of this README. Please refer to the Kubernetes and Helm documentation.
|
|
|
|
|
2018-09-13 21:48:40 +00:00
|
|
|
The versions required are:
|
|
|
|
|
|
|
|
* **Helm 2.10+** - This is the earliest version of Helm tested. It is possible
|
|
|
|
it works with earlier versions but this chart is untested for those versions.
|
2018-09-15 18:10:38 +00:00
|
|
|
* **Kubernetes 1.9+** - This is the earliest version of Kubernetes tested.
|
2018-09-13 21:48:40 +00:00
|
|
|
It is possible that this chart works with earlier versions but it is
|
2018-09-15 18:10:38 +00:00
|
|
|
untested. Other versions verified are Kubernetes 1.10, 1.11.
|
2018-09-13 21:48:40 +00:00
|
|
|
|
2018-08-18 05:27:43 +00:00
|
|
|
## Usage
|
|
|
|
|
2018-09-13 21:44:08 +00:00
|
|
|
For now, we do not host a chart repository. To use the charts, you must
|
2018-09-12 15:47:27 +00:00
|
|
|
download this repository and unpack it into a directory. Either
|
|
|
|
[download a tagged release](https://github.com/hashicorp/consul-helm/releases) or
|
|
|
|
use `git checkout` to a tagged release.
|
|
|
|
Assuming this repository was unpacked into the directory `consul-helm`, the chart can
|
2018-08-18 21:15:37 +00:00
|
|
|
then be installed directly:
|
2018-08-18 05:27:43 +00:00
|
|
|
|
2018-08-18 21:15:37 +00:00
|
|
|
helm install ./consul-helm
|
2018-08-18 05:27:43 +00:00
|
|
|
|
2018-08-18 21:15:37 +00:00
|
|
|
Please see the many options supported in the `values.yaml`
|
2018-08-18 05:27:43 +00:00
|
|
|
file. These are also fully documented directly on the
|
2018-09-10 16:38:27 +00:00
|
|
|
[Consul website](https://www.consul.io/docs/platform/k8s/helm.html).
|
2018-08-18 05:27:43 +00:00
|
|
|
|
2018-08-18 05:08:03 +00:00
|
|
|
## Testing
|
|
|
|
|
2018-09-03 20:02:06 +00:00
|
|
|
The Helm chart ships with both unit and acceptance tests.
|
2018-08-18 05:08:03 +00:00
|
|
|
|
2018-09-03 20:02:06 +00:00
|
|
|
The unit tests don't require any active Kubernetes cluster and complete
|
|
|
|
very quickly. These should be used for fast feedback during development.
|
|
|
|
The acceptance tests require a Kubernetes cluster with a configured `kubectl`.
|
2018-09-14 16:06:52 +00:00
|
|
|
Both require [Bats](https://github.com/bats-core/bats-core) and `helm` to be
|
|
|
|
installed and available on the CLI. The unit tests also require the correct
|
|
|
|
version of [yq](https://pypi.org/project/yq/) if running locally.
|
2018-08-18 05:08:03 +00:00
|
|
|
|
2018-09-03 20:02:06 +00:00
|
|
|
To run the unit tests:
|
2018-08-18 05:08:03 +00:00
|
|
|
|
2018-09-03 20:02:06 +00:00
|
|
|
bats ./test/unit
|
|
|
|
|
|
|
|
To run the acceptance tests:
|
|
|
|
|
|
|
|
bats ./test/acceptance
|
|
|
|
|
|
|
|
If the acceptance tests fail, deployed resources in the Kubernetes cluster
|
|
|
|
may not be properly cleaned up. We recommend recycling the Kubernetes cluster to
|
2018-08-18 05:08:03 +00:00
|
|
|
start from a clean slate.
|
|
|
|
|
|
|
|
**Note:** There is a Terraform configuration in the
|
2018-08-20 23:15:47 +00:00
|
|
|
[test/terraform/ directory](https://github.com/hashicorp/consul-helm/tree/master/test/terraform)
|
2018-08-18 05:08:03 +00:00
|
|
|
that can be used to quickly bring up a GKE cluster and configure
|
|
|
|
`kubectl` and `helm` locally. This can be used to quickly spin up a test
|
2018-09-10 16:38:27 +00:00
|
|
|
cluster for acceptance tests. Unit tests _do not_ require a running Kubernetes
|
2018-08-18 05:08:03 +00:00
|
|
|
cluster.
|