Overview
Rancher supports three primary methods for TLS certificate management:- Rancher-Generated Certificates - Rancher generates a self-signed certificate
- Let’s Encrypt - Automatically obtain and renew certificates from Let’s Encrypt
- Bring Your Own Certificate (BYO) - Use your own certificate from a trusted CA
Prerequisites
Before configuring TLS, ensure you have:- A Kubernetes cluster (RKE1, RKE2, K3s, AKS, EKS, or GKE)
- Helm 3 installed
- kubectl configured to access your cluster
- A fully qualified domain name (FQDN) for Rancher
Installation Methods
Option 1: Rancher-Generated TLS Certificate
This option is the simplest but uses a self-signed certificate. Browsers will show security warnings.Step 1: Install cert-manager
Cert-manager is required for Rancher to generate certificates.Step 2: Install Rancher
Install Rancher with the default TLS source:ingress.tls.source=rancher(default)ingress.tls.secretName=tls-rancher-ingress(default)
Understanding Rancher-Generated Certs
Wheningress.tls.source=rancher:
- Rancher creates a self-signed CA certificate
- The CA signs a certificate for your hostname
- The certificate is stored in the
tls-rancher-ingresssecret - cert-manager automatically renews the certificate before expiration
Option 2: Let’s Encrypt
Let’s Encrypt provides free, automatically-renewing certificates trusted by all major browsers.Step 1: Install cert-manager
Same as Option 1 above.Step 2: Install Rancher with Let’s Encrypt
ingress.tls.source=letsEncryptletsEncrypt.email=<your-email>(required)letsEncrypt.environment=production(default)letsEncrypt.ingress.class=(optional)
Let’s Encrypt Environments
Production Environment (default):- Issues trusted certificates
- Rate limited to 5 certificates per week per domain
- Use for production deployments
- Issues test certificates (not trusted by browsers)
- No rate limits
- Use for testing configurations
DNS Requirements
For Let’s Encrypt to work:- Your domain must be publicly accessible
- DNS must point to your Rancher load balancer
- Port 80 must be accessible for HTTP-01 challenge
Ingress Class for Let’s Encrypt
If you need to specify an ingress class for the ACME solver:Option 3: Bring Your Own Certificate
Use a certificate from your organization’s CA or a commercial certificate provider.Step 1: Create TLS Secret
Create a Kubernetes secret containing your certificate and private key:- Certificate must be PEM-encoded
- Certificate must be valid for your hostname
- Private key must be PEM-encoded
- Private key must not be password-protected
Step 2: Install Rancher
ingress.tls.source=secretingress.tls.secretName=tls-rancher-ingress(default, or specify custom name)
Custom Secret Name
If your secret has a different name:Private CA Certificates
If your certificate is signed by a private CA, add theprivateCA flag:
Certificate Chain
If you need to include intermediate certificates, concatenate them in order:Additional Trusted CAs
If you need Rancher to trust additional CAs (for example, to connect to external systems):Step 1: Enable Additional Trusted CAs
Step 2: Create CA Secret
tls-ca-additional and must be in the cattle-system namespace.
Ingress Configuration
Rancher uses Kubernetes Ingress for TLS termination. The Helm chart creates an Ingress resource automatically.Ingress TLS Source
Theingress.tls.source value determines where certificates come from:
| Value | Description |
|---|---|
rancher | Rancher generates a self-signed certificate |
letsEncrypt | cert-manager obtains a Let’s Encrypt certificate |
secret | Use a certificate from a Kubernetes secret |
Ingress Class
Specify an ingress class if needed:Ingress Annotations
Add custom annotations for your ingress controller:As of March 2026, ingress-nginx has been retired. Consider migrating to another ingress controller or using Gateway API.
Service Port
By default, the ingress connects to Rancher on port 80:Gateway API Configuration
As an alternative to Ingress, Rancher supports the Gateway API (available whennetworkExposure.type=gateway).
Gateway TLS Configuration
Gateway Certificate Options
Same three options as Ingress:- Rancher-generated:
gateway.gatewayClass.tls.source=rancher - Let’s Encrypt:
gateway.gatewayClass.tls.source=letsEncrypt - BYO:
gateway.gatewayClass.tls.source=secret
External TLS Termination
If you terminate TLS at an external load balancer (not recommended):tls=external
TLS Version Control
Control the minimum TLS version using environment variables:1.0- TLS 1.0 (not recommended)1.1- TLS 1.1 (not recommended)1.2- TLS 1.2 (recommended minimum)1.3- TLS 1.3 (recommended)
Agent TLS Mode
Control how Rancher agents validate TLS connections:strict- Agents validate certificates (recommended)system-store- Use system certificate store
strictfor new installations on Rancher 2.9+system-storefor Rancher 2.8 or older
Troubleshooting
Certificate Not Trusted
Problem: Browser shows “Your connection is not private” Solutions:-
For Rancher-generated certs: This is expected. Either:
- Accept the security warning (not recommended for production)
- Switch to Let’s Encrypt or BYO certificates
-
For Let’s Encrypt: Ensure:
- DNS points to your Rancher instance
- Port 80 is accessible for HTTP-01 challenge
- Email address is valid
- Not hitting rate limits (use staging first)
-
For BYO certs: Verify:
- Certificate is for the correct hostname
- Certificate is not expired
- Certificate chain includes intermediates
- If using private CA,
privateCA=trueis set
cert-manager Issues
Check cert-manager status:Let’s Encrypt Rate Limiting
If you hit Let’s Encrypt rate limits:- Wait for the rate limit to reset (1 week)
- Use the staging environment to test:
- Once working, switch back to production:
Secret Not Found
If using BYO certificates:Ingress Not Working
Verify ingress configuration:Best Practices
-
Production Deployments
- Use Let’s Encrypt or certificates from a trusted CA
- Never use self-signed certificates in production
- Set
agentTLSMode: strictfor better security - Use TLS 1.2 or higher as minimum version
-
Certificate Management
- Monitor certificate expiration dates
- Set up alerts for expiring certificates
- Test certificate renewal in staging first
- Keep private keys secure and never commit them to git
-
Let’s Encrypt
- Always test with staging environment first
- Ensure DNS is configured before installation
- Use a valid email address for renewal notifications
- Monitor rate limits
-
Private CA
- Properly configure
privateCA=true - Distribute CA certificate to all users
- Document CA trust requirements
- Set appropriate certificate validity periods
- Properly configure
-
cert-manager
- Keep cert-manager up to date
- Monitor cert-manager logs
- Test certificate renewal before expiration
- Configure appropriate resource limits
Verify Installation
After configuring TLS, verify Rancher is accessible:Upgrading Certificates
When upgrading Rancher, remember to specify the same certificate options:Next Steps
- Server Configuration - Configure Rancher server options
- Audit Logging - Enable audit logging
- Security Best Practices - Secure your deployment
- High Availability Setup - Configure HA Rancher