CKS: control plane certificates are never renewed or checked, and the stored kubeconfig isn't refreshed after upgrade
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 20/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- java, kubernetes
- Domaine
- backend-api-design, infrastructure
Piste de recherche
Start by tracing upgradeKubernetesCluster and getKubernetesClusterConfig, which the issue identifies as the upgrade and stored kubeconfig paths. Check how CKS reads and stores the control node’s kubeconfig, then inspect the related open pull request #14651 for work already underway. Done means refreshed kubeconfig data after certificate renewal and a decided approach for expiry checks and renewal.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
problem
CKS clusters are set up with kubeadm, which issues the control plane certificates (API server, front proxy, stacked etcd, and the client certificates in admin.conf, controller-manager.conf and scheduler.conf) for one year. The certificate authorities last ten years.
Nothing in CKS deals with that:
- No renewal. CKS never runs
kubeadm certs renew, and there is no API to do it. kubeadm's own answer is "upgrade at least once a year", sincekubeadm upgraderenews the certificates as a side effect. A cluster that isn't upgraded within a year stops working when the certificates expire: the API server rejects the controller manager, the scheduler and every admin client, and kubectl from CloudStack itself (/root/.kube/configon the control nodes) fails too. - No expiry check. Nothing warns the operator before that happens. There's no alert and no event.
- The stored kubeconfig is not refreshed after an upgrade.
getKubernetesClusterConfigreturns thekubeConfigDatacluster detail, which CKS only reads from the control node when the cluster starts.upgradeKubernetesClusterrenews the certificates,admin.confincluded, but the stored copy keeps the old admin certificate. Anyone who downloads the kubeconfig from CloudStack after an upgrade still gets a certificate that dies at the old expiry date. The same happens after renewing the certificates by hand.
Related: after an upgrade, /root/.kube/config on the control nodes, a copy of admin.conf that CKS uses for its own kubectl calls, also keeps the old certificate.
versions
main (and 4.22). The code involved hasn't changed in a long time, so earlier releases are affected too.
The steps to reproduce the bug
- Create a CKS cluster and leave it running.
- On a control node, run
sudo /opt/bin/kubeadm certs check-expiration. Every leaf certificate expires one year after creation, and nothing in CloudStack reports it. - Upgrade the cluster with
upgradeKubernetesCluster.check-expirationnow shows renewed certificates. - Call
getKubernetesClusterConfigand decode theclient-certificate-dataof the returned kubeconfig: its expiry is still the original one, a year after creation.
What to do about it?
- Refresh the stored kubeconfig after an upgrade and after a renewal.
- Check the certificate expiry periodically, and alert ahead of it (for example 60 and 30 days).
- Add an API that renews the control plane certificates one control node at a time and restarts the control plane static pods.
- Renew automatically, through the same path, some time before expiry (configurable).
- Langage dominant
- Java
- Étoiles
- 3.1k
- Forks
- 1.4k
- Merge moyen
- 7 j 16 h
- PR mergées (30 j)
- 15
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/cloudstack
-
resizeVolume of a running system VM's volume is accepted but the VM never sees the new sizePeut-être pris @bhouse-nexthop l’a pris il y a 4 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/cloudstack#14645 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
VR reports a load balancer change as applied when haproxy.cfg cannot be replacedPeut-être pris @bhouse-nexthop l’a pris il y a 4 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/cloudstack#14633 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)Peut-être pris @bhouse-nexthop l’a pris il y a 4 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/cloudstack#14631 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
apache/cloudstack#14625 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)Peut-être pris @willbennett-devops l’a pris il y a 12 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/cloudstack#14545 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de apache/cloudstack
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
ls1intum/thesis-management#1473 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
LunaDeerMC/Dominion#301 · 1 commentaire ·
-
[FEATURE] Expose external refresh, node-level translog and warmer statsPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverteuntriaged
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 2 jours