consul

by KubeGems

Helm chartv9.2.14App 1.10.0

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

The following table lists the configurable parameters of the HashiCorp Consul chart and their default values.

ParameterDescriptionDefault
global.imageRegistryGlobal Docker Image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
global.storageClassGlobal storage class for dynamic provisioningnil

Common parameters

ParameterDescriptionDefault
nameOverrideString to partially override consul.fullnamenil
fullnameOverrideString to fully override consul.fullnamenil
clusterDomainDefault Kubernetes cluster domaincluster.local
commonLabelsLabels to add to all deployed objectsnil
commonAnnotationsAnnotations to add to all deployed objects[]
extraDeployArray of extra objects to deploy with the release (evaluated as a template)nil
kubeVersionForce target Kubernetes version (using Helm capabilities if not set)nil

HashiCorp Consul parameters

ParameterDescriptionDefault
image.registryHashiCorp Consul image registrydocker.io
image.repositoryHashiCorp Consul image namebitnami/consul
image.tagHashiCorp Consul image tag{TAG_NAME}
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
image.debugSpecify if debug logs should be enabledfalse
datacenterNameHashiCorp Consul datacenter namedc1
domainHashiCorp Consul domainconsul
raftMultiplierMultiplier used to scale key Raft timing parameters1
gossipKeyGossip key for all membersnil
tlsEncryptionSecretNameName of existing secret with TLS encryption datanil
hostAliasesAdd deployment host aliases[]
configurationHashiCorp Consul configuration to be injected as ConfigMap{}
existingConfigmapName of existing ConfigMap with HashiCorp Consul configurationnil
localConfigExtra configuration that will be added to the default onenil
commandOverride default container command (useful when using custom images)nil
argsOverride default container args (useful when using custom images)nil
extraEnvVarsExtra environment variables to be set on HashiCorp Consul container{}
extraEnvVarsCMName of existing ConfigMap containing extra env varsnil
extraEnvVarsSecretName of existing Secret containing extra env varsnil
containerPorts.httpPort to open for HTTP in Consul8500
containerPorts.dnsPort to open for DNS server in Consul8600
containerPorts.rcpPort to open for RCP in Consul8400
containerPorts.rpcServerPort to open for RCP Server in Consul8300
containerPorts.serfLANPort to open for Serf LAN in Consul8301

Statefulset parameters

ParameterDescriptionDefault
replicaCountNumber of HashiCorp Consul replicas3
updateStrategyUpdate strategy type for the statefulsetRollingUpdate
rollingUpdatePartitionPartition update strategynil
priorityClassNameHashiCorp Consul priorityClassNamenil
podManagementPolicyStatefulSet pod management policyOrderedReady
podAnnotationsAdditional pod annotations{}
podLabelsAdditional pod labels{}
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{} (evaluated as a template)
nodeSelectorNode labels for pod assignment{} (evaluated as a template)
tolerationsTolerations for pod assignment[] (evaluated as a template)
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{}
livenessProbeLiveness probe configuration for HashiCorp ConsulCheck values.yaml file
readinessProbeReadiness probe configuration for HashiCorp ConsulCheck values.yaml file
customLivenessProbeOverride default liveness probenil
customReadinessProbeOverride default readiness probenil
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{} (evaluated as a template)
sidecarsAdd additional sidecar containers to the hashicorp consul pods{} (evaluated as a template)
pdb.createEnable/disable a Pod Disruption Budget creationfalse
pdb.minAvailableMinimum number/percentage of pods that should remain scheduled1
pdb.maxUnavailableMaximum number/percentage of pods that may be made unavailablenil

Exposure parameters

ParameterDescriptionDefault

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.2.14 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