etcd

by groundhog2k

Helm chartv1.1.16App v3.7.4

A Helm chart for etcd on Kubernetes

About this chart

Etcd

Changelog

see RELEASENOTES.md

A Helm chart for a Etcd HA-cluster on Kubernetes

TL;DR

helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/
helm install my-release groundhog2k/etcd

Introduction

This chart uses the original Etcd image from Quay.io to deploy a stateful Etcd cluster in Kubernetes.

It fully supports deployment of the multi-architecture docker image.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.x
  • PV provisioner support in the underlying infrastructure

Installing the Chart

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

helm install my-release groundhog2k/etcd

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm uninstall my-release

Common parameters

KeyTypeDefaultDescription
fullnameOverridestring""Fully override the deployment name
nameOverridestring""Partially override the deployment name

Deployment parameters

KeyTypeDefaultDescription
image.pullPolicystring"IfNotPresent"Image pull policy
image.registrystring"quay.io/coreos"Image registry
image.repositorystring"etcd"Image name
image.tagstring""Image tag
initImage.pullPolicystring"IfNotPresent"Init image pull policy
initImage.registrystring"docker.io"Image registry
initImage.repositorystring"busybox"Init image name
initImage.tagstring"stable"Init image tag
imagePullSecretslist[]Image pull secrets
extraInitContainerslist[]Extra init containers
extaContainerslist[]Extra containers for usage as sidecars
startupProbeobjectsee values.yamlStartup probe configuration
livenessProbeobjectsee values.yamlLiveness probe configuration
readinessProbeobjectsee values.yamlReadiness probe configuration
customStartupProbeobject{}Custom startup probe (overwrites default startup probe configuration)
customLivenessProbeobject{}Custom liveness probe (overwrites default liveness probe configuration)
customReadinessProbeobject{}Custom readiness probe (overwrites default readiness probe configuration)
resourcesobject{}Resource limits and requests
priorityClassNamestring""Deployment priority class name
nodeSelectorobject{}Deployment node selector
customLabelsobject{}Additional labels for Deployment or StatefulSet
customAnnotationsobject{}Additional annotations for Deployment or StatefulSet
podAnnotationsobject{}Additional pod annotations
podLabelsobject{}Additional pod labels
podSecurityContextobjectsee values.yamlPod security context
securityContextobjectsee values.yamlContainer security context
envlist[]Additional container environmment variables
argslist[]Additional container command arguments
rbac.createbooltrueEnable creation of RBAC
serviceAccount.annotationsobject{}Additional service account annotations
serviceAccount.createbooltrueEnable service account creation
serviceAccount.namestring""Optional name of the service account
serviceAccount.automountServiceAccountTokenbooltrueSpecifies whether a service account token should be automatically mounted
affinityobject{}Affinity for pod assignment
tolerationslist[]Tolerations for pod assignment
topologySpreadConstraintsobject{}Topology spread constraints for pods
podManagementPolicystring"Parallel"Pod management policy
updateStrategyTypestring"RollingUpdate"Pod update strategy
replicasint1Number of replicas (Due to the nature of etcd cluster initialization this value must be set before deploying the cluster)
revisionHistoryLimitintnilMaximum number of revisions maintained in revision history
podDisruptionBudgetobject{}Pod disruption budget
podDisruptionBudget.minAvailableintnilMinimum number of pods that must be available after eviction
podDisruptionBudget.maxUnavailableintnilMaximum number of pods that can be unavailable after eviction
clusterDomainstring"cluster.local"Kubernetes cluster domain (DNS) suffix

Service parameters

KeyTypeDefaultDescription
service.typestring"ClusterIP"Service type
service.clusterIPstringnilThe cluster ip address (only relevant for type LoadBalancer or NodePort)
service.loadBalancerIPstringnilThe load balancer ip address (only relevant for type LoadBalancer)
service.loadBalancerSourceRangeslist[]The list of IP CIDR ranges that are allowed to access the load balancer (only relevent for type LoadBalancer)
service.client.portint2379Client service port
service.client.nodePortintnilService node port (only relevant for type LoadBalancer or NodePort)
service.peer.portint2380Peer service port
service.peer.nodePortintnilService node port (only relevant for type LoadBalancer or NodePort)
service.annotationsobject{}Additional service annotations
service.labelsobject{}Additional service labels

Service monitor parameters

KeyTypeDefaultDescription
serviceMonitor.enabledboolfalseEnable service monitor
serviceMonitor.additionalLabelsobject{}Additional labels for the service monitor object
serviceMonitor.annotationsobject{}Annotations for the service monitor object
serviceMonitor.intervalDurationnilScrape interval for prometheus
serviceMonitor.scrapeTimeoutDurationnilScrape timeout value
serviceMonitor.extraEndpointParametersobjectnilExtra parameters rendered to the service monitor endpoint
serviceMonitor.extraParametersobjectnilExtra parameters rendered to the service monitor object

Network policies

Allows to define optional network policies for ingress and egress The policyTypes will be automatically set

KeyTypeDefaultDescription
networkPolicy.ingressobject{}Ingress network policies
networkPolicy.egressobject{}Egress network policies

Storage parameters

KeyTypeDefaultDescription
storage.accessModes[0]string"ReadWriteOnce"Storage access mode
storage.volumeNamestring"etcd-data"Internal volume name and prefix of a created PVC
storage.persistentVolumeClaimNamestringnilPVC name when existing storage volume should be used
storage.requestedSizestringnilSize for new PVC, when no existing PVC is used
storage.classNamestringnilStorage class name
storage.annotationsobject{}Additional storage annotations
storage.labelsobject{}Additional storage labels
extraStoragelist[]A list of additional existing PVC that will be mounted into the container
extraStorage[].namestringnilInternal name of the volume
extraStorage[].pvcNamestringnilName of the existing PVC
extraStorage[].mountPathstringnilMount path where the PVC should be mounted into the container

Etcd settings

KeyTypeDefaultDescription
settings.clusterTokenbool"etcd-cluster-0"Unique cluser token
settings.https.enabledboolfalseEnable HTTPS
settings.https.autoTlsboolfalseAutomatic TLS mode of etcd (TLS certs. created automaically)
settings.shutdownDelayint3Delay after termination request to give etcd process time for graceful shutdown
settings.advertiseClientUrls.internalbooltrueAdvertise the in-cluster client URL of every member (<protocol>://<pod>.<fullname>-internal.<namespace>.svc.<clusterDomain>:2379)
settings.advertiseClientUrls.extraDomainslist[]Additional domains - every member is additionally advertised as <protocol>://<pod>.<domain>:2379 (f.e. for access from outside of Kubernetes)

Clients which discover the cluster members via the member list use all advertised client URLs. If such clients run outside of Kubernetes and can't resolve the in-cluster names, set settings.advertiseClientUrls.internal to false. When TLS is enabled, the server certificates must contain the additional names as subject alternative names.

Etcd secrets and configuration

KeyTypeDefaultDescription
extraSecretslist[]A list of additional existing secrets that will be mounted into the container
extraSecrets[].namestringnilName of the existing K8s secret
extraSecrets[].defaultModeint0440Mount default access mode
extraSecrets[].mountPathstringnilMount path where the secret should be mounted into the container (f.e. /mysecretfolder)
extraConfigslist[]A list of additional existing configMaps that will be mounted into the container
extraConfigs[].namestringnilName of the existing K8s configMap
extraConfigs[].defaultModeint0440Mount default access mode
extraConfigs[].mountPathstringnilMount path where the configMap should be mounted into the container (f.e. /myconfigfolder)
extraEnvSecretslist[]A list of existing secrets that will be mounted into the container as environment variables

Deploy etcd with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has etcd 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 chartetcd is pinned at v1.1.16 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