Introduction
Este documento descreve o procedimento para renovar certificados Kubernetes no Cisco 5G RCM (Redundancy Configuration Manager).
Pré-requisito
Se for a configuração de Alta Disponibilidade do RCM, o procedimento deverá ser executado primeiro no RCM em standby, em seguida, execute um switchover e execute o procedimento no novo RCM em standby. Se não houver alta disponibilidade de RCM disponível, a redundância de UP não estará disponível durante a reinicialização de RCM, que faz parte do processo de renovação de certificados.
Verificar se os certificados expiraram
Para certificar-se de que os certificados tenham expirado, execute sudo kubeadm alpha certs check-expiration.
ubuntu@rcm:~$ sudo kubeadm alpha certs check-expiration
CERTIFICATE EXPIRES RESIDUAL TIME EXTERNALLY MANAGED
admin.conf Oct 31, 2024 03:34 UTC <invalid> no
apiserver Oct 31, 2024 03:34 UTC <invalid> no
apiserver-etcd-client Oct 31, 2024 03:34 UTC <invalid> no
apiserver-kubelet-client Oct 31, 2024 03:34 UTC <invalid> no
controller-manager.conf Oct 31, 2024 03:34 UTC <invalid> no
etcd-healthcheck-client Oct 31, 2024 03:34 UTC <invalid> no
etcd-peer Oct 31, 2024 03:34 UTC <invalid> no
etcd-server Oct 31, 2024 03:34 UTC <invalid> no
front-proxy-client Oct 31, 2024 03:34 UTC <invalid> no
scheduler.conf Oct 31, 2024 03:34 UTC <invalid> no
Renovar os certificados
Execute sudo kubeadm alpha certs renew all para renovar os certificados.
ubuntu@rcm:~$ sudo kubeadm alpha certs renew all
certificate embedded in the kubeconfig file for the admin to use and for kubeadm itself renewed
certificate for serving the Kubernetes API renewed
certificate the apiserver uses to access etcd renewed
certificate for the API server to connect to kubelet renewed
certificate embedded in the kubeconfig file for the controller manager to use renewed
certificate for liveness probes to healtcheck etcd renewed
certificate for etcd nodes to communicate with each other renewed
certificate for serving etcd renewed
certificate for the front proxy client renewed
certificate embedded in the kubeconfig file for the scheduler manager to use renewed
Verificar novamente se os certificados foram renovados
Execute sudo kubeadm alpha certs check-expiration para verificar se os certificados são renovados.
ubuntu@rcm:~$ sudo kubeadm alpha certs check-expiration
CERTIFICATE EXPIRES RESIDUAL TIME EXTERNALLY MANAGED
admin.conf Nov 01, 2025 03:34 UTC 364d no
apiserver Nov 01, 2025 03:34 UTC 364d no
apiserver-etcd-client Nov 01, 2025 03:34 UTC 364d no
apiserver-kubelet-client Nov 01, 2025 03:34 UTC 364d no
controller-manager.conf Nov 01, 2025 03:34 UTC 364d no
etcd-healthcheck-client Nov 01, 2025 03:34 UTC 364d no
etcd-peer Nov 01, 2025 03:34 UTC 364d no
etcd-server Nov 01, 2025 03:34 UTC 364d no
front-proxy-client Nov 01, 2025 03:34 UTC 364d no
scheduler.conf Nov 01, 2025 03:34 UTC 364d no
Modificar o kubelet.conf
Antes da versão 1.17 do kubeadm, é necessário modificar manualmente o kubelet.conf. Substitua client-certificate-data e client-key-data por este.
/etc/kubernetes/kubelet.conf
client-certificate:/var/lib/kubelet/pki/kubelet-client-current.pem
client-key: /var/lib/kubelet/pki/kubelet-client-current.pem
Copie admin.conf
Copie admin.conf para substituir .kube/config.
sudo cp /etc/kubernetes/admin.conf ~/.kube/config
Reinicialize o sistema
sudo reboot
Verifique se o comando kubectl funciona
Após a reinicialização, verifique se o comando kubectl funciona bem.
ubuntu@rcm:~$ kubectl get node
NAME STATUS ROLES AGE VERSION
rcm Ready master,oam 16d v1.15.12