consul
by [riftbit]
Highly available and distributed service discovery and key-value store designed with support for the modern data center to make distributed systems and configuration easy.
About this chart
HashiCorp Consul Helm Chart
HashiCorp Consul has multiple components, but as a whole, it is a tool for discovering and configuring services in your infrastructure
TL;DR
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/consul
Introduction
This chart bootstraps a HashiCorp Consul deployment on a Kubernetes cluster using the Helm package manager.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of Bitnami Kubernetes Production Runtime (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
Prerequisites
- Kubernetes 1.12+
- Helm 3.1.0
- PV provisioner support in the underlying infrastructure
Installing the Chart
To install the chart with the release name my-release:
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/consul
These commands deploy HashiCorp Consul on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete my-release
The command removes all the Kubernetes components associated with the chart and deletes the release. Remove also the chart using --purge option:
$ helm delete --purge my-release
Parameters
Global parameters
| Name | Description | Value |
|---|---|---|
global.imageRegistry | Global Docker image registry | "" |
global.imagePullSecrets | Global Docker registry secret names as an array | [] |
global.storageClass | Global StorageClass for Persistent Volume(s) | "" |
Common parameters
| Name | Description | Value |
|---|---|---|
kubeVersion | Override Kubernetes version | "" |
nameOverride | String to partially override common.names.fullname | "" |
fullnameOverride | String to fully override common.names.fullname | "" |
commonLabels | Labels to add to all deployed objects (sub-charts are not considered) | {} |
commonAnnotations | Annotations to add to all deployed objects (sub-charts are not considered) | {} |
clusterDomain | Kubernetes cluster domain name | cluster.local |
extraDeploy | Array of extra objects to deploy with the release | [] |
diagnosticMode.enabled | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | false |
diagnosticMode.command | Command to override all containers in the deployment | ["sleep"] |
diagnosticMode.args | Args to override all containers in the deployment | ["infinity"] |
HashiCorp Consul parameters
| Name | Description | Value |
|---|---|---|
image.registry | HashiCorp Consul image registry | docker.io |
image.repository | HashiCorp Consul image repository | bitnami/consul |
image.tag | HashiCorp Consul image tag (immutable tags are recommended) | 1.10.2-debian-10-r28 |
image.pullPolicy | HashiCorp Consul image pull policy | IfNotPresent |
image.pullSecrets | HashiCorp Consul image pull secrets | [] |
image.debug | Enable image debug mode | false |
datacenterName | Datacenter name for Consul. If not supplied, will use the Consul | dc1 |
domain | Consul domain name | consul |
raftMultiplier | Multiplier used to scale key Raft timing parameters | 1 |
gossipKey | Gossip key for all members. The key must be 16-bytes, can be generated with $(consul keygen) | "" |
tlsEncryptionSecretName | Name of existing secret with TLS encryption data | "" |
hostAliases | Deployment pod host aliases | [] |
configuration | HashiCorp Consul configuration to be injected as ConfigMap | "" |
existingConfigmap | ConfigMap with HashiCorp Consul configuration | "" |
localConfig | Extra configuration that will be added to the default one | "" |
command | Command for running the container (set to default if not set). Use array form | [] |
args | Args for running the container (set to default if not set). Use array form | [] |
extraEnvVars | Extra environment variables to be set on HashiCorp Consul container | [] |
extraEnvVarsCM | Name of existing ConfigMap containing extra env vars | "" |
extraEnvVarsSecret | Name of existing Secret containing extra env vars | "" |
containerPorts.http | Port to open for HTTP in Consul | 8500 |
containerPorts.dns | Port to open for DNS server in Consul | 8600 |
containerPorts.rpc | Port to open for RPC in Consul | 8400 |
containerPorts.rpcServer | Port to open for RPC Server in Consul | 8300 |
containerPorts.serfLAN | Port to open for Serf LAN in Consul | 8301 |
Statefulset parameters
| Name | Description | Value |
|---|---|---|
replicaCount | Number of HashiCorp Consul replicas to deploy | 3 |
updateStrategy | Update strategy type for the HashiCorp Consul statefulset | RollingUpdate |
rollingUpdatePartition | Partition update strategy | "" |
podManagementPolicy | StatefulSet pod management policy | Parallel |
podAnnotations | Additional pod annotations | {} |
podAffinityPreset | Pod affinity preset. Ignored if affinity is set. Allowed values: soft or hard | "" |
podAntiAffinityPreset | Pod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hard | soft |
nodeAffinityPreset.type | Node affinity preset type. Ignored if affinity is set. Allowed values: soft or hard | "" |
nodeAffinityPreset.key | Node label key to match. Ignored if affinity is set. | "" |
nodeAffinityPreset.values | Node label values to match. Ignored if affinity is set. | [] |
affinity | Affinity for pod assignment | {} |
nodeSelector | Node labels for pod assignment | {} |
tolerations | Tolerations for pod assignment | [] |
podSecurityContext.enabled | Enable security context for HashiCorp Consul pods | true |
podSecurityContext.fsGroup | Group ID for the volumes of the pod | 1001 |
containerSecurityContext.enabled | HashiCorp Consul Container securityContext | true |
containerSecurityContext.runAsUser | User ID for the HashiCorp Consul container | 1001 |
resources.limits | The resources limits for HashiCorp Consul containers | {} |
resources.requests | The requested resources for HashiCorp Consul containers | {} |
livenessProbe.enabled | Enable livenessProbe | true |
livenessProbe.initialDelaySeconds | Initial delay seconds for livenessProbe | 30 |
livenessProbe.periodSeconds | Period seconds for livenessProbe | 10 |
livenessProbe.timeoutSeconds | Timeout seconds for livenessProbe | 5 |
livenessProbe.failureThreshold | Failure threshold for livenessProbe | 6 |
livenessProbe.successThreshold | Success threshold for livenessProbe | 1 |
readinessProbe.enabled | Enable readinessProbe | true |
readinessProbe.initialDelaySeconds | Initial delay seconds for readinessProbe | 5 |
readinessProbe.periodSeconds | Period seconds for readinessProbe | 10 |
readinessProbe.timeoutSeconds | Timeout seconds for readinessProbe | 5 |
readinessProbe.failureThreshold | Failure threshold for readinessProbe | 6 |
readinessProbe.successThreshold | Success threshold for readinessProbe | 1 |
customLivenessProbe | Override default liveness probe | {} |
customReadinessProbe | Override default readiness probe | {} |
extraVolumeMounts | Optionally specify extra list of additional volumeMounts for Hashicorp Consul container | [] |
extraVolumes | Optionally specify extra list of additional volumes for Hashicorp Consul container | [] |
initContainers | Add additional init containers to the Hashicorp Consul pods | [] |
sidecars | Add additional sidecar containers to the Hashicorp Consul pods | [] |
pdb.create | Enable/disable a Pod Disruption Budget cre |
Deploy consul with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has consul on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartconsul is pinned at v9.3.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply