CA rotation: controller-manager needs a separate ca.crt file #1350
Description
What happened?
I tried to (manually) rotate my cluster's CA key over the weekend. I discovered that /etc/kubernetes/pki/ca.crt
can actually include multiple CA keys, and this is key (hah!) to rotating the CA key.
kube-controller-manager
however, can only accept a single key in the file pointed to by --cluster-signing-cert-file
, since this is the key used to sign things, and not to verify things (so having multiple keys doesn't make sense). kube-controller-manager
exits immediately (with a helpful error) if --cluster-signing-cert-file
includes multiple keys.
I think pointing kube-controller-manager --cluster-signing-cert-file
to ca.crt
works for the simple (single key) case, but is incorrect in general, since it prevents ca.crt
file from being used to rotate keys. I think the correct path is to either:
- Use a different file for
--cluster-signing-cert-file
that only contains the single "primary" CA cert.
or - Change kube-controller-manager upstream to only use the first cert in
ca.crt
or some other logic to ignore additional certs.
What you expected to happen?
Able to append a new CA cert to /e/k/pki/ca.crt
and have both CA certs accepted by controller jobs without other impact.
How to reproduce it (as minimally and precisely as possible)?
Append an additional cert to /e/k/pki/ca.crt and restart kube-controller-manager pod
Metadata
Assignees
Labels
Type
Projects
Status
Pending other SIGs