aloof-dentist-47314
02/28/2025, 3:13 PM/var/lib/rancher/rke2/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml -n cattle-system logs cattle-cluster-agent-xxxxx-xxx
returned an error indicating that the certificate had expired (the same ca was found in the Rancher VM).
The same error appeared in the Rancher agent logs when checking with:
journalctl -xeu rancher-system-agent
My Solution:
1. Replaced the CA in Rancher (the certificate was fine, only the CA was incorrect).
2. This changed the checksum in the Rancher registration cluster, so I replaced it in each master node's cattle-cluster-agent
deployment.
3. With that, the cluster was recovered, but the Rancher agent continued showing the error.
4. After searching through the code, I found the file: /var/lib/rancher/agent/rancher2_connection_info.json
5. I updated certificate-authority-data
with the base64-encoded correct CA.
6. After making this change on every node, the cluster in Rancher started running correctly, and all nodes appeared green.
Some Questions:
• Does Rancher internally work with 60-day certificates?
• Does my solution introduce security concerns?
• After updating a certificate, the guide Update Rancher Certificate mentions that it is necessary to update the cluster certificate, but it says nothing about the Rancher agent. Could this be a bug? (I don’t know if updating a self-signed certificate is a considered scenario.)creamy-pencil-82913
02/28/2025, 4:08 PMaloof-dentist-47314
02/28/2025, 5:02 PMcertificate-authority-data
in all nodes file /var/lib/rancher/agent/rancher2_connection_info.json
, no more logs about
• i dont know why ca.pem was different in rancher server (the exactly 60 days cert makes me think is a rancher behavior, but is speculation)
• i need to test if updating ca in json file, allow to update self signed cert
I hope this clarifies for youcreamy-pencil-82913
02/28/2025, 6:05 PMaloof-dentist-47314
02/28/2025, 6:17 PMdocker run -v $PWD/cert:/certs \
-e SSL_SUBJECT=rancherfqdn \
-e SSL_DNS=rancherfqdn \
-e SSL_IP=10.0.0.1 -e SSL_EXPIRE=3650 -e CA_SUBJECT=subject \
superseb/omgwtfssl
the cert was generated with this command, the ca generated, not respect the SSL_EXPIRE variable, only the cert has the correct expire datealoof-dentist-47314
02/28/2025, 6:20 PMcreamy-pencil-82913
02/28/2025, 6:30 PMcreamy-pencil-82913
02/28/2025, 6:30 PMcreamy-pencil-82913
02/28/2025, 6:32 PMaloof-dentist-47314
02/28/2025, 6:32 PMaloof-dentist-47314
02/28/2025, 6:34 PMaloof-dentist-47314
03/05/2025, 6:27 PM/var/lib/rancher/agent/rancher2_connection_info.json
(because the certificate itself acts as the CA).
For private certificates, the CA typically expires in 10-20 years, which might become a problem in the future.
Does this warrant opening a ticket?