Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

elasticsearch chart optimizes the discovery.seed_hosts Settings #1785

Open
jiaxinonly opened this issue Mar 8, 2023 · 1 comment
Open

elasticsearch chart optimizes the discovery.seed_hosts Settings #1785

jiaxinonly opened this issue Mar 8, 2023 · 1 comment

Comments

@jiaxinonly
Copy link

jiaxinonly commented Mar 8, 2023

Chart version: 8.5.1

Kubernetes version: v1.23.16

Kubernetes provider: local

Helm Version: v3.11.0

When the number of replicas reaches 1, the following will be printed frantically:

This node is a fully-formed single-node cluster with cluster UUID [p7UZF7CJQBOg3FZy5KSC5w], but it is configured as if to discover other nodes and form a multi-node cluster via the [discovery.  seed_hosts=[elasticsearch-headless]] setting.   Fully-formed clusters do not attempt to discover other nodes, and nodes with different cluster UUIDs cannot belong to the same cluster.

I need to remove the discovery.seed hosts environment variable,It is recommended to optimize chart. Here is a simple solution,modify the statefulset.yaml file.

          {{- if gt (int .Values.replicas) 1 }}
          - name: discovery.seed_hosts
            value: "{{ template "elasticsearch.masterService" . }}-headless"
          {{- end }}

image

@jiaxinonly jiaxinonly changed the title chart optimizes the discovery.seed hosts Settings elasticsearch chart optimizes the discovery.seed hosts Settings Mar 8, 2023
@jiaxinonly jiaxinonly changed the title elasticsearch chart optimizes the discovery.seed hosts Settings elasticsearch chart optimizes the discovery.seed_hosts Settings Mar 8, 2023
@ataillefer
Copy link

Same issue on my side. As a workaround, we're using kustomize (through helmfile) with:

  # Suppress warning about node discovery in a single-node cluster.
  # The discovery.seed_hosts env var is set when ES version is < 7,
  # unfortunately it cannot be customized through chart values.
  strategicMergePatches:
  - apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      name: elasticsearch-master
    spec:
      template:
        spec:
          containers:
          - name: elasticsearch
            env:
            - name: discovery.seed_hosts
              $patch: delete

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants