Kubernetes
live cluster management
control-plane-endpoint
cluster configuration
DevOps

How to change control-plane-endpoint option in a live cluster?

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

Changing controlPlaneEndpoint on a running Kubernetes cluster is a migration, not a single configuration toggle. That endpoint is copied into kubeadm state, kubeconfig files, certificates, DNS, and often a load balancer, so the safe approach is to introduce the new endpoint first and then update every dependency in a controlled order.

What controlPlaneEndpoint Actually Affects

In a kubeadm-managed cluster, controlPlaneEndpoint is the stable address other components use to reach the API server. It is usually a DNS name or virtual IP in front of one or more control-plane nodes. The setting is important because kubeadm uses it when generating kubeconfig files and join configuration.

What it does not do is magically rewire the whole cluster after the fact. If you change only the value stored in a ConfigMap, old kubeconfigs still point to the old address, certificates may still have the old hostname in their subject alternative names, and clients may fail TLS validation even if DNS resolves correctly.

Before touching the cluster, inspect the current state:

bash
1kubectl -n kube-system get configmap kubeadm-config -o yaml
2grep '^\s*server:' /etc/kubernetes/*.conf
3openssl x509 -in /etc/kubernetes/pki/apiserver.crt -text -noout \
4| grep -A1 'Subject Alternative Name' ``` Those three checks tell you where the old endpoint is currently embedded. ## A Safe Migration Sequence The first requirement is a working new endpoint. That usually means a DNS record such as `api.example.com` or a load balancer IP that already forwards traffic to the existing API servers. Do this first, and test it before you change cluster files. If the new name or IP is not reachable yet, the rest of the migration only creates outage risk. Next, make sure the API server certificate is valid for the new address. If the hostname or IP changes, the certificate must contain the new value in its SAN list. With kubeadm, that is typically handled by preparing an updated configuration file and renewing the API server certificate. Example kubeadm configuration: ```yaml apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration controlPlaneEndpoint: api.example.com:6443 apiServer: certSANs: - api.example.com - 10.0.0.50 networking: podSubnet: 10.244.0.0/16 ``` After preparing the file, regenerate the pieces that depend on the endpoint: ```bash sudo kubeadm certs renew apiserver --config kubeadm-new-endpoint.yaml sudo kubeadm init phase kubeconfig all --config kubeadm-new-endpoint.yaml sudo systemctl restart kubelet ``` On highly available control planes, repeat the certificate and kubeconfig work carefully on each control-plane node. Roll one node at a time and confirm the API remains reachable through the new endpoint before moving on. If worker nodes and operators use kubeconfig files that still contain the old server address, distribute updated configs. For example, `admin.conf`, controller-manager, scheduler, and kubelet client configs may all need to be refreshed depending on how the cluster was bootstrapped. ## Updating kubeadm State and Verifying the Result Once the live endpoint works and the certificate is valid, update kubeadm's stored cluster configuration so future operations use the same value. In practice, that usually means editing the `kubeadm-config` ConfigMap to match the new endpoint and keeping the file you used for regeneration under version control. Verification matters more than the edit itself. Check the endpoint from outside and inside the cluster, then confirm node health and control-plane stability. ```bash kubectl cluster-info kubectl get nodes kubectl get pods -n kube-system kubectl --kubeconfig=/etc/kubernetes/admin.conf get --raw=/readyz?verbose ``` If you front the control plane with a new load balancer, also test direct TCP reachability and DNS resolution from a worker node. Slow DNS propagation can make the migration appear random when different nodes resolve different answers. One practical rule helps avoid downtime: do not retire the old endpoint immediately. Leave it functional during the cutover window so existing clients can continue working while you rotate kubeconfigs and confirm that the new address is in use everywhere. ## When This Is Not a Simple Live Change Some environments need more than a kubeadm refresh. Managed Kubernetes offerings often control the API endpoint for you, and clusters built without kubeadm may store the server address in different locations. If the change also involves a new advertised address for the API servers, different certificates, or a new network path between nodes and the control plane, treat it as a broader control-plane migration and schedule maintenance. ## Common Pitfalls The most common mistake is updating DNS or the kubeadm ConfigMap and assuming the cluster is done. It is not. Existing kubeconfigs and TLS certificates still carry the old endpoint until you regenerate or replace them. Another frequent issue is forgetting certificate SANs. If the new endpoint is not listed in the API server certificate, clients will see TLS errors even though the API server is healthy. Teams also get tripped up by immediate cutovers. If you delete the old load balancer or lower-level DNS name too early, stale client configs stop working and recovery becomes harder. Keep overlap between old and new endpoints until validation is complete. ## Summary - '`controlPlaneEndpoint` changes are migrations, not a one-line live toggle.' - Create and test the new DNS name or load balancer before changing cluster files. - Renew API server certificates if the hostname or IP changes. - Regenerate kubeconfigs and update kubeadm state so future operations stay consistent. - Keep the old endpoint available during the cutover until every client has moved.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.