Is changing cluster.name safe during a Kubernetes rolling update (StatefulSet)?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 3.7.0

Describe the issue:

We run OpenSearch 3.7.0 on Kubernetes via Helm. The cluster.name is set through the CLUSTER_NAME environment variable, which gets substituted into opensearch.yml:

cluster:

name: ${CLUSTER_NAME}

Topology (dedicated mode):

  • Manager StatefulSet: 3 replicas, RollingUpdate, podManagementPolicy: Parallel
  • Data StatefulSet: 2 replicas, RollingUpdate
  • Client Deployment: 3 replicas, RollingUpdate

Scenario: On helm upgrade, if we change the cluster.name value, Kubernetes performs a rolling update — replacing pods one at a time. During the transition, some pods will have the old cluster.name and some will have the new one.

Questions:

  1. Will a node with cluster.name=beta be able to join/discover existing nodes running cluster.name=alpha?

  2. After the rolling update completes and all nodes have the new cluster.name, will they reform the original cluster using the persisted cluster state and cluster_uuid on the PVCs? Or will they bootstrap a fresh cluster?

  3. Is a full cluster restart (scale to 0 → change name → scale back up) the only safe way to rename? Would data on existing PVCs be preserved in that case?

We’re evaluating whether to block cluster.name changes on helm upgrade or allow it with a specific procedure.

Thanks!

Hi @shubtiwa ,

Renaming an OpenSearch cluster with the OpenSearch Helm charts will create new PVCs that point to new PVs. Also, the Helm charts will regenerate all pods in the StatefulSet with new names matching the cluster name. As a result, the new nodes will point to the new PVCs and will lose access to the original PVCs (data).