etcd

by CloudPirates

Helm chartv0.9.2App 3.7.3Apache-2.0Verified publisher

etcd is a distributed reliable key-value store for the most critical data of a distributed system

About this chart

etcd Helm Chart

etcd is a distributed reliable key-value store for the most critical data of a distributed system, with a focus on being simple, secure, fast, and reliable.

Quick Start

Prerequisites

  • Kubernetes 1.24+
  • Helm 3.2.0+
  • PV provisioner support in the underlying infrastructure (if persistence is enabled)

Installation

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

helm install my-etcd oci://registry-1.docker.io/cloudpirates/etcd

To install with custom values:

helm install my-etcd oci://registry-1.docker.io/cloudpirates/etcd -f my-values.yaml

Or install directly from the local chart:

helm install my-etcd ./charts/etcd

Uninstalling

To uninstall/delete the my-etcd deployment:

helm delete my-etcd

Getting Started

  1. Check the status of your etcd cluster:
kubectl exec -it my-etcd-0 -- etcdctl \
  --endpoints=my-etcd:2379 \
  endpoint health
  1. Connect to etcd from inside the cluster:
kubectl run etcd-client --rm --tty -i --restart='Never' \
    --image gcr.io/etcd-development/etcd:v3.6.0-alpha.0 -- bash

# Inside the pod:
etcdctl --endpoints=my-etcd:2379 endpoint status --write-out=table

Security & Signature Verification

This Helm chart is cryptographically signed with Cosign to ensure authenticity and prevent tampering.

Public Key:

-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5U+rM2d3hDjgP5T3cLShuuQIU9vR
Z4/G+Nug6q5vRa+C3qUA1wXjbaJFAfcIrv5VjmYAYOj13shnPpp3Zh4fnQ==
-----END PUBLIC KEY-----

To verify the helm chart before installation, copy the public key to the file cosign.pub and run cosign:

cosign verify --key cosign.pub registry-1.docker.io/cloudpirates/etcd:<version>

Configuration

Global Parameters

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registry override""
global.imagePullSecretsGlobal Docker registry secret names[]

Image Configuration

ParameterDescriptionDefault
image.registryetcd image registrygcr.io
image.repositoryetcd image repositoryetcd-development/etcd
image.tagetcd image tagv3.6.5@sha256:3397341272b9e0a6f44d7e3fc7c321c6efe6cbe82ce866b9b01d0c704bfc5bf3
image.pullPolicyImage pull policyIfNotPresent

Common Parameters

ParameterDescriptionDefault
nameOverrideString to partially override etcd.fullname""
fullnameOverrideString to fully override etcd.fullname""
namespaceOverrideString to override the namespace for all resources""
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}
replicaCountNumber of etcd replicas to deploy (must be odd)3
podLabelsAdditional labels for etcd pods{}
podAnnotationsAdditional annotations for etcd pods{}
clusterDomainDNS suffix for internal service discovery"cluster.local"

Service Configuration

ParameterDescriptionDefault
service.typeKubernetes service typeClusterIP
service.annotationsService annotations{}
service.clientPortetcd client port2379
service.peerPortetcd peer port2380
service.metricsPortetcd metrics port2381
service.loadBalancerSourceRangesAllowed source CIDRs when service type is LoadBalancer[]
service.loadBalancerIPLoad balancer IP when service type is LoadBalancer""

Authentication and Security

ParameterDescriptionDefault
auth.enabledEnable client-to-server TLS authenticationfalse
auth.existingSecretName of existing secret containing client certificates""
auth.peer.enabledEnable peer-to-peer TLS authenticationfalse
auth.peer.existingSecretName of existing secret containing peer certificates""

etcd Configuration

ParameterDescriptionDefault
config.initialClusterStateInitial cluster state (new or existing)new
config.autoCompactionModeAuto compaction mode (periodic or revision)periodic
config.autoCompactionRetentionAuto compaction retention1
config.snapshotCountNumber of transactions to trigger a snapshot10000
config.quotaBackendBytesBackend storage quota in bytes (2GB)2147483648
config.maxRequestBytesMaximum client request size in bytes1572864
config.logLevelLog level (debug, info, warn, error, panic, fatal)info
config.initialClusterTokenInitial cluster tokenetcd-cluster
config.heartbeatIntervalHeartbeat interval in milliseconds100
config.electionTimeoutElection timeout in milliseconds1000
config.maxSnapshotsMaximum number of snapshot files to retain5
config.maxWalsMaximum number of WAL files to retain5
config.listenPeerIpIP address to bind for peer traffic0.0.0.0
config.listenClientIpIP address to bind for client traffic0.0.0.0

Persistence

ParameterDescriptionDefault
persistence.enabledEnable persistence using PVCtrue
persistence.storageClassStorage class of backing PVC""
persistence.annotationsAnnotations for the PVC{}
persistence.labelsLabels for persistent volume claims{}
persistence.sizeSize of data volume8Gi
persistence.accessModesPersistent Volume Access Modes[ReadWriteOnce]
persistence.mountPathMount path for data volume/var/run/etcd

Resources

ParameterDescriptionDefault
resourcesCPU/Memory resource requests/limits{}

StatefulSet Configuration

ParameterDescriptionDefault
updateStrategy.typeStatefulSet update strategyRollingUpdate

Metrics Configuration

ParameterDescriptionDefault
metrics.enabledEnable Prometheus metricstrue
metrics.serviceMonitor.enabledCreate ServiceMonitor for Prometheus Operatorfalse
metrics.serviceMonitor.namespaceNamespace for ServiceMonitor""
metrics.serviceMonitor.intervalScrape interval30s
metrics.serviceMonitor.scrapeTimeoutScrape timeout""
metrics.serviceMonitor.relabelingsRelabel configurations[]
metrics.serviceMonitor.metricRelabelingsMetric relabel configurations[]
metrics.serviceMonitor.labelsAdditional labels for ServiceMonitor{}
metrics.serviceMonitor.honorLabelsHonor labels from metricsfalse

High Availability

ParameterDescriptionDefault
podDisruptionBudget.enabledEnable PodDisruptionBudgetfalse
podDisruptionBudget.minAvailableMinimum number of available pods""
podDisruptionBudget.maxUnavailableMaximum number of unavailable pods1

Service Account

ParameterDescriptionDefault
serviceAccount.createCreate service accounttrue
serviceAccount.nameService account name""
serviceAccount.annotationsService account annotations{}
serviceAccount.automountServiceAccountTokenAutomount service account tokenfalse

Network Policy

ParameterDescriptionDefault
networkPolicy.enabledEnable NetworkPolicyfalse
networkPolicy.allowExternalAllow external traffictrue
networkPolicy.extraIngressAdditional ingress rules[]
networkPolicy.extraEgressAdditional egress rules[]

Security Context

ParameterDescriptionDefault
containerSecurityContext.runAsUserUser ID to run the container1000
containerSecurityContext.runAsGroupGroup ID to run the container1000
containerSecurityContext.runAsNonRootRun as non-root usertrue
containerSecurityContext.allowPrivilegeEscalationAllow privilege escalationfalse
containerSecurityContext.readOnlyRootFilesystemMount root filesystem as read-onlytrue
containerSecurityContext.capabilities.dropLinux capabilities to drop[ALL]
podSecurityContext.fsGroupGroup ID for the volumes1000

Probes

ParameterDescriptionDefault
startupProbe.enabledEnable startup probetrue
startupProbe.initialDelaySecondsInitial delay for startup probe0
startupProbe.periodSecondsPeriod for startup probe10
startupProbe.timeoutSecondsTimeout for startup probe5
startupProbe.failureThresholdFailure threshold for startup probe30
livenessProbe.enabledEnable liveness probetrue
livenessProbe.initialDelaySecondsInitial delay for liveness probe10
livenessProbe.periodSecondsPeriod for liveness probe10
livenessProbe.timeoutSecondsTimeout for liveness probe5
livenessProbe.failureThresholdFailure threshold for liveness probe3
readinessProbe.enabledEnable readiness probetrue
readinessProbe.initialDelaySecondsInitial delay for readiness probe5
readinessProbe.periodSecondsPeriod for readiness probe10
readinessProbe.timeoutSecondsTimeout for readiness probe

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 v0.9.2 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