elasticsearch-eck
by somaz94
Elasticsearch Custom Resource for ECK (Elastic Cloud on Kubernetes) with HTTPRoute, BackendTLSPolicy, PDB and ServiceMonitor wrappers. Defaults to a single-node cluster; HA via nodeSets.
About this chart
elasticsearch-eck
A Helm chart for Elasticsearch on Kubernetes via the ECK operator.
The chart renders the ECK Elasticsearch Custom Resource plus a handful of optional siblings (elastic-user Secret, HTTPRoute, BackendTLSPolicy, PodDisruptionBudget, ServiceMonitor). Defaults target a single-node dev/staging cluster; production HA is opt-in via nodeSets[].
What it deploys
| Resource | API | Purpose |
|---|---|---|
Elasticsearch | elasticsearch.k8s.elastic.co/v1 | The cluster CR. ECK reconciles StatefulSets, Services, Secrets. |
Secret (elastic user) | v1 | Optional. Pre-seeded elastic user password when elasticPassword is set. |
PodDisruptionBudget | policy/v1 | Optional (external mode). Prefer podDisruptionBudget.native: true which renders PDB inside the CR. |
HTTPRoute | gateway.networking.k8s.io/v1 | Optional. Gateway API route for external access. |
BackendTLSPolicy + CA ConfigMap | gateway.networking.k8s.io/v1, v1 | Optional. Verifies ECK self-signed HTTPS cert from the Gateway. Chart auto-copies ca.crt from ECK's *-es-http-certs-public Secret into a <fullname>-ca ConfigMap via helm lookup (only portable approach — see Known limitations). |
ServiceMonitor | monitoring.coreos.com/v1 | Optional. Prometheus scrape config for /_prometheus/metrics. |
StackConfigPolicy | stackconfigpolicy.k8s.elastic.co/v1alpha1 | Optional. Declarative stack configuration — index templates, cluster settings, ILM/SLM policies, ingest pipelines, security roles — applied and reconciled by the operator. |
Versioning
This chart follows Helm's standard semantics:
Chart.yamlversion — the chart's own SemVer. Bumped manually by the maintainer viamake bump CHART=elasticsearch-eck LEVEL=patch|minor|majorfor template or schema changes.Chart.yamlappVersion — the Elastic Stack version shipped by the chart (defaultvalues.version). Bumped by./upgrade.shwhen a new Elasticsearch GA lands. Chart version is not automatically mirrored.values.yamlversion — thespec.versionrendered into the Elasticsearch CR. Defaults toappVersion; override to pin a different version at install time.values.yamlimage — optional full image reference override (private mirrors, air-gapped registries).
Prerequisites
-
Kubernetes 1.25+
-
ECK Operator installed (provides the
elasticsearch.k8s.elastic.coCRDs):helm repo add elastic https://helm.elastic.co helm install eck-operator elastic/eck-operator -n elastic-system --create-namespace -
A StorageClass for the ES data PVC. You MUST supply one that exists in your cluster — this chart ships no StorageClass. Common choices:
Environment Typical StorageClass Bare-metal / NFS nfs-client,nfs-subdir-external-provisionerAWS EKS gp3,gp2,io2GCP GKE standard,standard-rwo,premium-rwoAzure AKS managed-csi,managed-premiumOn-prem Ceph ceph-block,rook-ceph-blockLocal-path (kind/k3s dev only) local-path,standardSet it in values:
nodeSets: - name: default storage: storageClass: nfs-client # ← put YOUR cluster's SC here size: 30GiLeave
storageClass: ""only if your cluster has a default StorageClass markedstorageclass.kubernetes.io/is-default-class: "true". -
For
httproute.enabled: true: Gateway API CRDs + a Gateway controller (e.g. NGINX Gateway Fabric) -
For
serviceMonitor.enabled: true: Prometheus Operator
Check what's available in your cluster:
kubectl get storageclass
Install
These snippets install the latest published chart. To pin an exact chart version, add --version <x.y.z> — released versions are the GitHub Release tags named elasticsearch-eck-<version>.
OCI registry (Helm 3.8+)
helm install es oci://ghcr.io/somaz94/charts/elasticsearch-eck \
--namespace logging --create-namespace \
-f my-values.yaml
Classic Helm repo
helm repo add somaz94 https://charts.somaz.blog
helm repo update
helm install es somaz94/elasticsearch-eck \
--namespace logging --create-namespace \
-f my-values.yaml
Quick examples
1. Minimal (single-node, dev/staging)
One all-roles node, 30 GiB PVC. Pick a StorageClass that exists in your cluster (see Prerequisites above):
# my-values.yaml
elasticPassword: "changeme"
nodeSets:
- name: default
count: 1
storage:
storageClass: nfs-client # ← replace with your SC (gp3 / standard / ceph-block / ...)
size: 30Gi
helm install es oci://ghcr.io/somaz94/charts/elasticsearch-eck \
--namespace logging --create-namespace \
-f my-values.yaml
Omitting storageClass falls back to the cluster's default SC — only works if one is marked default (kubectl get sc shows (default) next to it).
2. Production HA (3 master + 3 data, zero-downtime rolling)
Pick block storage, not NFS. NFS RWO works for single-node dev but causes data corruption risk with multiple writers. AWS:
gp3/io2, GCP:premium-rwo, Ceph:ceph-block, vSphere:vsphere-csi.
Zero-downtime rolling upgrades in HA topology are verified; the doc header records the chart and Stack versions the run used. See ../../docs/ha-rolling-verification.md for the test procedure, load generator, and result log.
nodeSets:
- name: master
count: 3
roles: [master]
resources:
requests: {cpu: 500m, memory: 2Gi}
limits: {cpu: 1000m, memory: 2Gi}
storage:
storageClass: ceph-block # ← your block SC (NOT NFS)
size: 10Gi
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
elasticsearch.k8s.elastic.co/node-master: "true"
- name: data
count: 3
roles: [data, ingest, transform]
resources:
requests: {cpu: 1000m, memory: 8Gi}
limits: {cpu: 4000m, memory: 8Gi}
storage:
storageClass: ceph-block # ← your block SC (NOT NFS)
size: 500Gi
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
elasticsearch.k8s.elastic.co/node-data: "true"
podDisruptionBudget:
native: true
maxUnavailable: 1
updateStrategy:
changeBudget:
maxSurge: 1
maxUnavailable: 1
3. Behind a Gateway (NGF) with TLS verification
httproute:
enabled: true
parentRefs:
- name: ngf
namespace: nginx-gateway
hostnames:
- elasticsearch.example.com
rules:
- matches:
- path: {type: PathPrefix, value: /}
backendRefs:
- port: 9200
backendTLSPolicy:
enabled: true
Default behavior (
caCertificateRef.kind: ConfigMap,name: ""): the chart copiesca.crtfrom the ECK-managed Secret<name>-es-http-certs-publicinto a<name>-caConfigMap viahelm lookup, and BTP references that ConfigMap. On first install, the Secret does not exist yet — re-runhelm upgradeonce Elasticsearch is Ready so the ConfigMap (and the BTP) can render.Advanced — externally-managed ConfigMap: set
caCertificateRef.name: <your-cm>(kind staysConfigMap) to point BTP at a ConfigMap you manage out-of-band (e.g. via the Reflector operator or External Secrets). The chart will no longer render the ConfigMap in that case.Advanced — Secret kind (NOT supported for ECK on NGF):
caCertificateRef.kind: Secretis exposed for completeness, but NGINX Gateway Fabric rejectstype: OpaqueSecrets (onlykubernetes.io/tlsis honored). ECK's*-es-http-certs-publicis Opaque, so this path fails withInvalidCACertificateRefon NGF. Use only with a curatedkubernetes.io/tlsSecret.
4. Advanced — escape hatches
Every ECK CR field is reachable. If something is not surfaced as a named value, inject it via specExtra, podTemplateExtra, or nodeSets[].nodeSetExtra:
secureSettings:
- secretName: s3-snapshot-creds
specExtra:
revisionHistoryLimit: 5
nodeSets:
- name: default
count: 1
podTemplateExtra:
spec:
hostNetwork: false
dnsPolicy: ClusterFirst
nodeSetExtra:
podManagementPolicy: Parallel
Values reference
The tables below mirror values.yaml, which is authoritative; values.schema.json enforces the shape.
Top-level
| Key | Default | Description |
|---|---|---|
commonLabels | {} | Labels applied to every resource. |
commonAnnotations | {} | Annotations applied to every resource (merged with per-resource extras). |
resourceMetadata | {} | Per-resource labels/annotations override. Keys: elasticsearch, elasticUserSecret, podDisruptionBudget, httproute, backendTLSPolicy, serviceMonitor. |
name | "" | CR name. Empty → Helm release name. |
version | tracks Chart.yaml appVersion — see values.yaml | Elastic Stack version (ES spec.version). Bump via ./upgrade.sh. |
image | "" | Optional image override (private mirrors / air-gapped). |
elasticPassword | "" | Password for the elastic superuser. Empty → ECK auto-generates. |
serviceAccountName | "" | Optional SA for IRSA / restricted RBAC. |
http | ECK self-signed TLS | Passthrough to spec.http (tls, service). |
transport | {} | Passthrough to spec.transport. |
secureSettings | [] | ECK secureSettings array (keystore sources). |
auth | {} | ECK spec.auth (roles, fileRealm). |
volumeClaimDeletePolicy | "" | DeleteOnScaledownOnly keeps the data PVCs when the Elasticsearch resource is deleted; the ECK default (DeleteOnScaledownAndClusterDeletion) removes them. Empty leaves ECK's default. |
revisionHistoryLimit | "" | StatefulSet revisions retained for rollback. Empty leaves ECK's default. |
remoteClusterServer | {} | Enable the remote cluster server when this cluster is accessed via API key auth for CCR/CCS. |
remoteClusters | [] | CCR/CCS connections. |
monitoring | {} | Stack Monitoring config. |
updateStrategy | {} | ECK changeBudget for rolling updates. |
specExtra | {} | Escape hatch: extra fields merged into spec. |
sysctlInitContainer.enabled | true | Privileged init container that raises node sysctls before Elasticsearch starts. |
sysctlInitContainer.sysctls | {vm.max_map_count: 1048576} | Map of sysctl name to desired value, applied as a floor — raised only when the node is below it, never lowered. Node-level, not persisted across a reboot. |
nodeSets[]
| Key | Default | Description |
|---|---|---|
name | required | nodeSet name (used in StatefulSet name). |
count | required | Number of pods in the StatefulSet. |
roles | (all roles) | node.roles setting. |
zoneAwareness | {} | Topology-aware scheduling plus shard allocation awareness, so replicas land in a different zone from their primary. Only meaningful when nodes span zones. |
config | {node.store.allow_mmap: false} | Free-form elasticsearch.yml content (merged with node.roles). |
resources | 100m/2Gi → 1000m/2Gi | Container resources for the elasticsearch container. |
storage.storageClass | "" | PVC StorageClass — provide your own. Empty → cluster default SC (only works if one is marked default). See Prerequisites for common SC names per environment. |
storage.size | 30Gi | PVC size for the default elasticsearch-data volume. |
storage.accessModes | [ReadWriteOnce] | PVC accessModes. |
volumeClaimTemplates | [] | Extra PVCs (beyond the default elasticsearch-data). Full ECK shape. |
nodeSelector / tolerations / affinity / topologySpreadConstraints | {}/[] | Pod scheduling. |
priorityClassName | "" | Pod priority class. |
initContainers / sidecars | [] | Extra containers (full container spec). |
env / envFrom / volumes / volumeMounts | [] | Extra env/volume config on the elasticsearch container. |
livenessProbe / readinessProbe / startupProbe / lifecycle | {} | Container probes & lifecycle. |
podSecurityContext / securityContext | {} | Pod-level and container-level security contexts. |
serviceAccountName | "" | Per-nodeSet SA override (rare). |
containerExtra | {} | Escape hatch: merged into the elasticsearch container. |
podTemplateExtra | {} | Escape hatch: merged into spec.podTemplate. |
nodeSetExtra | {} | Escape hatch: merged into the nodeSet entry. |
podDisruptionBudget
| Key | Default | Description |
|---|---|---|
native | false | Render PDB inside the Elasticsearch CR (ECK-managed). Recommended. |
external | false | Render a separate policy/v1 PodDisruptionBudget. Use only when ECK native is insufficient. |
maxUnavailable | 1 | Applies to both modes. |
minAvailable | null | Alternative to maxUnavailable (mutually exclusive). |
httproute / backendTLSPolicy
Standard Gateway API HTTPRoute fields; see the values.yaml for the full shape. backendRefs[].name defaults to <fullname>-es-http and backendRefs[].port defaults to 9200.
backendTLSPolicy.caCertificateRef selects the CA bundle source:
kind | name | Chart behavior |
|---|---|---|
ConfigMap (default) | "" (default) | Chart renders `<fullname |
Deploy elasticsearch-eck with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has elasticsearch-eck 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartelasticsearch-eck is pinned at v0.3.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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