kubernetes 인증서 갱신 및 Cert IP 추가 방법

Kubernetes 인증서 갱신


kubectl get nodes
kubeadm certs check-expiration
cp -rp /etc/kubernetes/ /etc/kubernetes_230717
cp -pr ~/.kube/ ~/kube_230717
kubeadm certs renew all
kubeadm certs check-expiration
kubectl get nodes
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get pod -n kube-system
kill -s SIGHUP $(pidof kube-apiserver)
kill -s SIGHUP $(pidof kube-controller-manager)
kill -s SIGHUP $(pidof kube-scheduler)
systemctl restart kubelet


Kubernetes Cert IP 추가


cp -rp /etc/kubernetes/pki/apiserver.* /etc/kubernetes/pki/apiserver_230717

ADD_IP="127.0.0.1"
kubeadm init phase certs apiserver --apiserver-cert-extra-sans ${ADD_IP}
// ex. kubeadm init phase certs apiserver --apiserver-cert-extra-sans '10.10.0.246,10.10.0.171,10.10.0.11,127.0.0.1'
systemctl restart kubelet
kubectl get cm/kubeadm-config -n kube-system -o yaml | sed -n '1,20p'
You've successfully subscribed to taking
Great! Next, complete checkout to get full access to all premium content.
Error! Could not sign up. invalid link.
Welcome back! You've successfully signed in.
Error! Could not sign in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.