Environments:
OS: Ubuntu 18.04.5 LTS
Kubernetes: v1.16.15
deployment tool: kubeadm v1.16.15
I initialize a single-node K8s on my workstation with the following configuraions:
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
kubernetesVersion: v1.16.15
imageRepository: k8s.gcr.io
clusterName: kubernetes
controlPlaneEndpoint: HOSTNAME-01
networking:
dnsDomain: cluster.local
podSubnet: 10.244.0.0/16
serviceSubnet: 10.96.0.0/12
apiServer:
certSANs:
- HOSTNAME-01
extraArgs:
advertise-address: 0.0.0.0
authorization-mode: Node,RBAC
timeoutForControlPlane: 4m0s
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
nodeRegistration:
name: HOSTNAME-01
I want to change the hostname from HOSTNAME-01 to HOSTNAME-02, and apply the setting to my workstation and the K8s cluster.
Is there a better way to do it rather than reset the cluster?