How to rotate Talos and Kubernetes API root certificate authorities.
talosconfig
or kubeconfig
;talosctl
command, as it will contain the new CA certificate and key.
Record a list of Talos API users to make sure they can all be updated with new talosconfig
.
Run the following command to rotate the Talos API CA:
Once the rotation is done, stash the new Talos CA, update secrets.yaml
(if using that for machine configuration generation) with new CA key and certificate.
The new client talosconfig
is written to the current directory as talosconfig
.
You can merge it to the default location with talosctl config merge ./talosconfig
.
If other client access talosconfig
files needs to be generated, use talosctl config new
with new talosconfig
.
Note: if using Talos API access from Kubernetes feature, pods might need to be restarted manually to pick up new talosconfig
.
talosctl gen secrets
and use Talos CA)..machine.acceptedCAs
with new CA certificate.talosconfig
with client certificate generated with new CA, but still using old CA as server CA, verify connectivity, Talos should accept new client certificate..machine.ca
with new CA certificate and key, and keeping old CA certificate in .machine.acceptedCAs
(on worker nodes .machine.ca
doesn’t have the key).talosconfig
with both client certificate and server CA using new CA PKI, verify connectivity..machine.acceptedCAs
on all nodes.kube-apiserver
, kubelet
, etc.
Other Kubernetes secrets might need to be rotated manually as required.
Kubernetes pods might need to be restarted to handle changes, and communication within the cluster might be disrupted during the rotation process.
Run the following command in dry-run mode to see the steps which will be taken:
talosctl
command, as it will contain the new CA certificate and key.
As Talos API access will not be disrupted, the changes can be reverted back if needed by reverting machine configuration.
Run the following command to rotate the Kubernetes API CA:
kubelet
will re-join the cluster with new client certficiate.
New kubeconfig
can be fetched with talosctl kubeconfig
command from the cluster.
Kubernetes pods might need to be restarted manually to pick up changes to the Kubernetes API CA.
.cluster.acceptedCAs
in place of .machine.acceptedCAs
;.cluster.ca
in place of .machine.ca
;kubeconfig
in place of talosconfig
.