consul

by joaquinito2051

Helm chartv4.2.5App 1.5.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 install <helm-repo>/consul

$ helm install 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.4+ with Beta APIs enabled
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/consul

$ helm install --name my-release bitnami/consul The command deploys HashiCorp Consul on the Kubernetes cluster in the default configuration. The configuration 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

Configuration

The following tables 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)
image.registryHashiCorp Consul image registrydocker.io
image.repositoryHashiCorp Consul image namebitnami/consul
image.tagHashiCorp Consul image tag{VERSION}
image.pullPolicyImage pull policyAlways
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
replicasNumber of replicas3
portHashiCorp Consul http listening port8500
service.rpcPortHashiCorp Consul rpc listening port8400
service.serflanPortContainer serf lan listening port8301
service.serverPortContainer server listening port8300
service.consulDnsPortContainer dns listening port8600
service.uiPortHashiCorp Consul UI port80
datacenterNameHashiCorp Consul datacenter namedc1
gossipKeyGossip key for all membersnil
domainHashiCorp Consul domainconsul
clientAddressAddress in which HashiCorp Consul will bind client interfaces0.0.0.0
serflanAddressAddress used for Serf LAN communications0.0.0.0
raftMultiplierMultiplier used to scale key Raft timing parameters10Gi
securityContext.enabledEnable security contexttrue
securityContext.fsGroupGroup ID for the container1001
securityContext.runAsUserUser ID for the container1001
updateStrategy.typeStatefulset update strategy policyRollingUpdate
persistence.enabledUse a PVC to persist datatrue
persistence.storageClassStorage class of backing PVCnil (uses alpha storage class annotation)
persistence.accessModeUse volume as ReadOnly or ReadWriteReadWriteOnce
persistence.sizeSize of data volume8Gi
persistence.annotationsAnnotations for the persistent volumenil
resourcesContainer resource requests and limits{}
maxUnavailablePod disruption Budget maxUnavailable1
nodeAffinityHashiCorp Consul pod node-affinity settingnil
antiAffinityHashiCorp Consul pod anti-affinity settingsoft
ui.service.enabledUse a service to access HashiCorp Consul Uitrue
ui.service.typeKubernetes Service TypeClusterIP
ui.service.annotationsAnnotations for HashiCorp Consul UI service{}
ui.service.loadBalancerIPIP if HashiCorp Consul UI service type is LoadBalancernil
ingress.enabledEnable ingress controller resourcefalse
ingress.certManagerAdd annotations for cert-managerfalse
ingress.annotationsIngress annotations[]
ingress.hosts[0].nameHostname to your HashiCorp Consul installationconsul-ui.local
ingress.hosts[0].pathPath within the url structure/
ingress.hosts[0].tlsUtilize TLS backend in ingressfalse
ingress.hosts[0].tlsSecretTLS Secret (certificates)consul-ui.local-tls
ingress.secrets[0].nameTLS Secret Namenil
ingress.secrets[0].certificateTLS Secret Certificatenil
ingress.secrets[0].keyTLS Secret Keynil
configmapHashiCorp Consul configuration to be injected as ConfigMapnil
metrics.enabledStart a side-car prometheus exporterfalse
metrics.imageExporter imageprom/consul-exporter
metrics.imageTagExporter image tagv0.3.0
metrics.imagePullPolicyExporter image pull policyIfNotPresent
metrics.resourcesExporter resource requests/limit{}
metrics.podAnnotationsExporter annotations{}
nodeSelectorNode labels for pod assignment{}
livenessProbe.initialDelaySecondsDelay before liveness probe is initiated30
livenessProbe.periodSecondsHow often to perform the probe10
livenessProbe.timeoutSecondsWhen the probe times out5
livenessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1
livenessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.6
podAnnotationsPod annotations{}
readinessProbe.initialDelaySecondsDelay before readiness probe is initiated5
readinessProbe.periodSecondsHow often to perform the probe10
readinessProbe.timeoutSecondsWhen the probe times out5
readinessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1
readinessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.6

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
$ helm install --name my-release --set domain=consul-domain,gossipKey=secretkey <helm-repo>/consul

The above command sets the HashiCorp Consul domain to consul-domain and sets the gossip key to secretkey. $ helm install --name my-release --set domain=consul-domain,gossipKey=secretkey bitnami/consul

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For exampl

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 v4.2.5 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