Tags: kubernetes
Kublr-provisioned Kubernetes clusters expose Kubernetes API on a port 443 or 6443 by default depending on the target environment (e.g. cloud or on-prem). Sometimes it is necessary to change this port to a different value on an existing cluster. It may be done via the procedure described in this article.
Note that the procedure requires the cluster downtime so plan accordingly.
1. Change the port number and the master group update policy in the cluster specification and run the cluster update:
spec: network: apiServerSecurePort: 2443 master: updateStrategy: drainStrategy: skip: true rollingUpdate: maxUnavailable: 100%
2. When the cluster admin kubeconfig file is updated and is available for download, download it and configure kubectl for using it
3. Delete in-cluster default kubernetes API service; Kubernetes will automatically recreate it after a few seconds with the new port number
kubectl delete -n default svc kubernetes
4. Wait for the cluster to recover and become healthy
5. Change the master group update policy back to normal