elasticsearch-eck

by somaz94

Helm chartv0.3.5App 9.5.6Apache-2.0Verified publisher

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

ResourceAPIPurpose
Elasticsearchelasticsearch.k8s.elastic.co/v1The cluster CR. ECK reconciles StatefulSets, Services, Secrets.
Secret (elastic user)v1Optional. Pre-seeded elastic user password when elasticPassword is set.
PodDisruptionBudgetpolicy/v1Optional (external mode). Prefer podDisruptionBudget.native: true which renders PDB inside the CR.
HTTPRoutegateway.networking.k8s.io/v1Optional. Gateway API route for external access.
BackendTLSPolicy + CA ConfigMapgateway.networking.k8s.io/v1, v1Optional. 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).
ServiceMonitormonitoring.coreos.com/v1Optional. Prometheus scrape config for /_prometheus/metrics.
StackConfigPolicystackconfigpolicy.k8s.elastic.co/v1alpha1Optional. 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.yaml version — the chart's own SemVer. Bumped manually by the maintainer via make bump CHART=elasticsearch-eck LEVEL=patch|minor|major for template or schema changes.
  • Chart.yaml appVersion — the Elastic Stack version shipped by the chart (default values.version). Bumped by ./upgrade.sh when a new Elasticsearch GA lands. Chart version is not automatically mirrored.
  • values.yaml version — the spec.version rendered into the Elasticsearch CR. Defaults to appVersion; override to pin a different version at install time.
  • values.yaml image — optional full image reference override (private mirrors, air-gapped registries).

Prerequisites

  • Kubernetes 1.25+

  • ECK Operator installed (provides the elasticsearch.k8s.elastic.co CRDs):

    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:

    EnvironmentTypical StorageClass
    Bare-metal / NFSnfs-client, nfs-subdir-external-provisioner
    AWS EKSgp3, gp2, io2
    GCP GKEstandard, standard-rwo, premium-rwo
    Azure AKSmanaged-csi, managed-premium
    On-prem Cephceph-block, rook-ceph-block
    Local-path (kind/k3s dev only)local-path, standard

    Set it in values:

    nodeSets:
      - name: default
        storage:
          storageClass: nfs-client    # ← put YOUR cluster's SC here
          size: 30Gi
    

    Leave storageClass: "" only if your cluster has a default StorageClass marked storageclass.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 copies ca.crt from the ECK-managed Secret <name>-es-http-certs-public into a <name>-ca ConfigMap via helm lookup, and BTP references that ConfigMap. On first install, the Secret does not exist yet — re-run helm upgrade once Elasticsearch is Ready so the ConfigMap (and the BTP) can render.

Advanced — externally-managed ConfigMap: set caCertificateRef.name: <your-cm> (kind stays ConfigMap) 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: Secret is exposed for completeness, but NGINX Gateway Fabric rejects type: Opaque Secrets (only kubernetes.io/tls is honored). ECK's *-es-http-certs-public is Opaque, so this path fails with InvalidCACertificateRef on NGF. Use only with a curated kubernetes.io/tls Secret.

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

KeyDefaultDescription
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.
versiontracks Chart.yaml appVersion — see values.yamlElastic 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.
httpECK self-signed TLSPassthrough 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.enabledtruePrivileged 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[]

KeyDefaultDescription
namerequirednodeSet name (used in StatefulSet name).
countrequiredNumber 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).
resources100m/2Gi → 1000m/2GiContainer 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.size30GiPVC 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

KeyDefaultDescription
nativefalseRender PDB inside the Elasticsearch CR (ECK-managed). Recommended.
externalfalseRender a separate policy/v1 PodDisruptionBudget. Use only when ECK native is insufficient.
maxUnavailable1Applies to both modes.
minAvailablenullAlternative 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:

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

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartelasticsearch-eck is pinned at v0.3.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