Skip to content

CKS: control plane certificates are never renewed or checked, and the stored kubeconfig isn't refreshed after upgrade #14650

Open

Description

@bhouse-nexthop

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:

  1. 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", since kubeadm upgrade renews 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/config on the control nodes) fails too.
  2. No expiry check. Nothing warns the operator before that happens. There's no alert and no event.
  3. The stored kubeconfig is not refreshed after an upgrade. getKubernetesClusterConfig returns the kubeConfigData cluster detail, which CKS only reads from the control node when the cluster starts. upgradeKubernetesCluster renews the certificates, admin.conf included, 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

  1. Create a CKS cluster and leave it running.
  2. 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.
  3. Upgrade the cluster with upgradeKubernetesCluster. check-expiration now shows renewed certificates.
  4. Call getKubernetesClusterConfig and decode the client-certificate-data of 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).

Activity

  1. added this to the 4.22.3 milestone on Nov 11, 2026
  2. github-actions commented on Nov 11, 2026

    @github-actions

    Warning

    threat detection engine error
    The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

    What happened

    The threat detection engine failed to produce results.

    Review the workflow run logs for details.

    🎯 Triage report

    CKS never renews or checks the kubeadm control plane certificates, which expire after one year. Upgrades renew them as a side effect, but the stored kubeconfig is not refreshed afterwards, so downloads keep a certificate that expires on the original date. The reporter asks for a stored-kubeconfig refresh after upgrade and renewal, periodic expiry checks with alerts, a renewal API, and optional automatic renewal. Open PR #14651 is linked to this issue.

    📊 Assessment

    Dimension Value Reasoning
    Type type:enhancement New renewal and monitoring behaviour, plus a stale-data fix
    Component component:cks CKS cluster certificates and stored kubeconfig
    Severity n/a Expiry is a year out; the reporter describes it as a missing capability
    Labels type:enhancement, component:cks
    Coding agent Not suitable Renewal API, alerting and automatic renewal are design decisions; PR #14651 already covers them

    🔗 Similar issues

    💡 Notes and suggestions
    • Check: sudo /opt/bin/kubeadm certs check-expiration on a control node, then getKubernetesClusterConfig, then decode client-certificate-data.
    • The stored-kubeconfig refresh after upgrade could be split from the renewal and alerting work.

    Generated by Daily Issue Triage · copilot · haiku55 · ~6 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions