pai
pai copied to clipboard
K8s API server's cert need renew each year
The k8s API server's cert will expire every year, and will cause OpenPAI cluster not available. Certificate Management with kubeadm: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#automatic-certificate-renewal
How to fix
- renew k8s cert
- upgrade the kube-config in all worker nodes
Todo
- [ ] Document this requirement in the repo
- [x] Add warning for the cert expire
refer: https://github.com/kubernetes/kubeadm/issues/581#issuecomment-471575078
Test case:
- setup the alert-manager to enable the
email-admin
action (change theadmin-receiver
to a test address) - change the
schedule
andalert-residual-days
inalert-manager.cert-expiration-checker
fromservices-configuration.yaml
to trigger the alert:cert-expiration-checker: schedule: '* * * * *' # every minute alert-residual-days: 365 # always trigger cert-path: '/etc/kubernetes/ssl' # the k8s cert path in master node
- use kubectl get pods to check whether the
cert-expiration-checker
cronjob be triggered - check the alert email or the logs from alert handler.