Skip to main content

Fix Error Agent Unavailable on Rancher

Find agent pod for Rancher

kubectl get pods -n cattle-system

Show error logs

kubectl logs -n cattle-system cattle-cluster-agent-<id>

Result:

ERROR: The environment variable CATTLE_CA_CHECKSUM is set but there is no CA certificate configured at https://<domain>/v3/settings/cacerts

Find CATTLE_CA_CHECKSUM configuration

kubectl describe deployment -n cattle-system cattle-cluster-agent
kubectl get svc -n cattle-system cattle-cluster-agent
kubectl get svc -n cattle-system cattle-cluster-agent -o yaml
kubectl get deployment -n cattle-system cattle-cluster-agent -o yaml

Update value of CATTLE_CA_CHECKSUM if it is necessary

Open the URL and copy the CA certificate.

https://<domain>/v3/settings/cacerts

Generate checksum:

sha256sum rancher-ca.crt

Edit the value on deployment:

kubectl edit deployment cattle-cluster-agent -n cattle-system

Restart the service

kubectl rollout restart deployment cattle-cluster-agent -n cattle-system