You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding secrets I had issues with kubectl -n cattle-system create secret generic tls-ca --from-file=/root/cacerts.pem as it would give the following error failed to setup TLS listener: read /etc/rancher/ssl/cacerts.pem: is a directory.
However kubectl -n cattle-system create secret generic tls-ca --from-file=cacerts.pem worked
Pulled from rancher manager Provider: RKE2 Kubernetes Version: v1.30.5 +rke2r1 Architecture: Amd64 Created: 1.1 hours ago
kubectl root@rancher-uk-01:~# kubectl version Client Version: v1.30.5+rke2r1 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.30.5+rke2r1
I did not manually update helm after installing it using curl -s https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
Helm Version root@rancher-uk-01:~# helm version version.BuildInfo{Version:"v3.16.2", GitCommit:"13654a52f7c70a143b1dd51416d633e1071faffb", GitTreeState:"clean", GoVersion:"go1.22.7"}
So after creating 2 new VM's I can say that my initial issue was some odd fluke/random issue.
It works fine on both fresh VM with /root/cacerts.pem after copying the same commands from the first node
Weird, not sure what happened with the previous node considering I am using the same commands
However the file has to be named cacerts.pem if it is anything else it will error out with failed to setup TLS listener: read /etc/rancher/ssl/cacerts.pem: is a directory like before. (This was further testing)
Hi Andy, how are you doing? Hope you're good, man :-)
Andy, the guys deployd a new root CA here at the company, so I'll have to update the certificate on my Rancher environment, and I taking a look on how to do it.
As this is the first time I'm doing that, I'm looking into the documentation (https://ranchermanager.docs.rancher.com/v2.8/getting-started/installation-and-upgrade/resources/update-rancher-certificate), and also found your video on YouTube as well (thanks for that, really helpful, Andy, not to mention the funny moment you tell you forgot the cert files haha)
One question that I have is when I get to that part related to update the CA certificate secret object (cacerts.pem)...
I've got the new root CA .pfx file, so in order to have the cacerts.pem I'll have to convert the .pfx file into the .pem format.
I believe that the command below (with the "-nodes" parameter) is the one I need to do that conversion, right?
openssl pkcs12 -in mycert.pfx -out cacerts.pem -nodes
If you could tell how you got your cacerts.pem file, I would really appreciate it.
I know this is probably unrelated to your connection timeout issue with the Rancher endpoint, but I wanted to share a recommendation regarding the method you used to install the certificates.
I’ve tried a similar approach in the past, and while it wasn’t the cause of your specific issue, it did fail for me due to Rancher not receiving the full certificate chain. This led to problems with TLS handshake validation.
Instead, I’d highly recommend following the method outlined in [Techno Tim’s guide](https://technotim.live/posts/kube-traefik-cert-manager-le/) for setting up wildcard certificates with Traefik and cert-manager. His guide walks you through using DNS validation with your DNS provider’s API token to request certificates directly from Let’s Encrypt. You can even practice with staging certificates, but I’d suggest going “full send” and using production.
Why This Matters:
Rancher handles certificates differently and requires the full certificate chain for proper TLS validation. If this chain isn’t provided, it can lead to handshake failures. To ensure everything works smoothly, you need to prepare your certificates and secrets before installing Rancher.
The Correct Process:
Assuming you’ve followed Tim’s guide and cert-manager has issued certificates, you should have a certificate and corresponding secret in your namespace. For example:
➜ kubectl get certificates
NAME READY SECRET AGE
yorko-io True yorko-io-tls 11m
➜ kubectl get secrets
NAME TYPE DATA AGE
yorko-io-tls kubernetes.io/tls 2 13m
Now, here’s how you prepare these certificates for Rancher:
Rancher requires the full certificate chain to be presented during the TLS handshake. The single domain certificate issued by Let’s Encrypt doesn’t include the intermediate CA, which some clients need to validate the connection. By combining the certificates and properly configuring the Helm chart, you ensure compatibility across all clients and prevent TLS handshake issues.
I hope this helps resolve any certificate-related issues and simplifies your setup for the future! Let me know if you have questions.
When adding secrets I had issues with
kubectl -n cattle-system create secret generic tls-ca --from-file=/root/cacerts.pem
as it would give the following errorfailed to setup TLS listener: read /etc/rancher/ssl/cacerts.pem: is a directory
.However
kubectl -n cattle-system create secret generic tls-ca --from-file=cacerts.pem
workedEdit: Here is the reference link https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/resources/update-rancher-certificate#2-createupdate-the-ca-certificate-secret-object