consul

by [riftbit]

Helm chartv9.3.6App 1.10.2Verified publisher

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

NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.storageClassGlobal StorageClass for Persistent Volume(s)""

Common parameters

NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override common.names.fullname""
fullnameOverrideString to fully override common.names.fullname""
commonLabelsLabels to add to all deployed objects (sub-charts are not considered){}
commonAnnotationsAnnotations to add to all deployed objects (sub-charts are not considered){}
clusterDomainKubernetes cluster domain namecluster.local
extraDeployArray of extra objects to deploy with the release[]
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the deployment["sleep"]
diagnosticMode.argsArgs to override all containers in the deployment["infinity"]

HashiCorp Consul parameters

NameDescriptionValue
image.registryHashiCorp Consul image registrydocker.io
image.repositoryHashiCorp Consul image repositorybitnami/consul
image.tagHashiCorp Consul image tag (immutable tags are recommended)1.10.2-debian-10-r28
image.pullPolicyHashiCorp Consul image pull policyIfNotPresent
image.pullSecretsHashiCorp Consul image pull secrets[]
image.debugEnable image debug modefalse
datacenterNameDatacenter name for Consul. If not supplied, will use the Consuldc1
domainConsul domain nameconsul
raftMultiplierMultiplier used to scale key Raft timing parameters1
gossipKeyGossip key for all members. The key must be 16-bytes, can be generated with $(consul keygen)""
tlsEncryptionSecretNameName of existing secret with TLS encryption data""
hostAliasesDeployment pod host aliases[]
configurationHashiCorp Consul configuration to be injected as ConfigMap""
existingConfigmapConfigMap with HashiCorp Consul configuration""
localConfigExtra configuration that will be added to the default one""
commandCommand for running the container (set to default if not set). Use array form[]
argsArgs for running the container (set to default if not set). Use array form[]
extraEnvVarsExtra environment variables to be set on HashiCorp Consul container[]
extraEnvVarsCMName of existing ConfigMap containing extra env vars""
extraEnvVarsSecretName of existing Secret containing extra env vars""
containerPorts.httpPort to open for HTTP in Consul8500
containerPorts.dnsPort to open for DNS server in Consul8600
containerPorts.rpcPort to open for RPC in Consul8400
containerPorts.rpcServerPort to open for RPC Server in Consul8300
containerPorts.serfLANPort to open for Serf LAN in Consul8301

Statefulset parameters

NameDescriptionValue
replicaCountNumber of HashiCorp Consul replicas to deploy3
updateStrategyUpdate strategy type for the HashiCorp Consul statefulsetRollingUpdate
rollingUpdatePartitionPartition update strategy""
podManagementPolicyStatefulSet pod management policyParallel
podAnnotationsAdditional pod annotations{}
podAffinityPresetPod affinity preset. Ignored if affinity is set. Allowed values: soft or hard""
podAntiAffinityPresetPod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hardsoft
nodeAffinityPreset.typeNode affinity preset type. Ignored if affinity is set. Allowed values: soft or hard""
nodeAffinityPreset.keyNode label key to match. Ignored if affinity is set.""
nodeAffinityPreset.valuesNode label values to match. Ignored if affinity is set.[]
affinityAffinity for pod assignment{}
nodeSelectorNode labels for pod assignment{}
tolerationsTolerations for pod assignment[]
podSecurityContext.enabledEnable security context for HashiCorp Consul podstrue
podSecurityContext.fsGroupGroup ID for the volumes of the pod1001
containerSecurityContext.enabledHashiCorp Consul Container securityContexttrue
containerSecurityContext.runAsUserUser ID for the HashiCorp Consul container1001
resources.limitsThe resources limits for HashiCorp Consul containers{}
resources.requestsThe requested resources for HashiCorp Consul containers{}
livenessProbe.enabledEnable livenessProbetrue
livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe30
livenessProbe.periodSecondsPeriod seconds for livenessProbe10
livenessProbe.timeoutSecondsTimeout seconds for livenessProbe5
livenessProbe.failureThresholdFailure threshold for livenessProbe6
livenessProbe.successThresholdSuccess threshold for livenessProbe1
readinessProbe.enabledEnable readinessProbetrue
readinessProbe.initialDelaySecondsInitial delay seconds for readinessProbe5
readinessProbe.periodSecondsPeriod seconds for readinessProbe10
readinessProbe.timeoutSecondsTimeout seconds for readinessProbe5
readinessProbe.failureThresholdFailure threshold for readinessProbe6
readinessProbe.successThresholdSuccess threshold for readinessProbe1
customLivenessProbeOverride default liveness probe{}
customReadinessProbeOverride default readiness probe{}
extraVolumeMountsOptionally specify extra list of additional volumeMounts for Hashicorp Consul container[]
extraVolumesOptionally specify extra list of additional volumes for Hashicorp Consul container[]
initContainersAdd additional init containers to the Hashicorp Consul pods[]
sidecarsAdd additional sidecar containers to the Hashicorp Consul pods[]
pdb.createEnable/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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartconsul is pinned at v9.3.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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