Skip to content

Instantly share code, notes, and snippets.

@mallardduck
Created September 23, 2025 13:43
Show Gist options
  • Save mallardduck/f94dca09a422c5eab2bdc5ab392a6b8d to your computer and use it in GitHub Desktop.
Save mallardduck/f94dca09a422c5eab2bdc5ab392a6b8d to your computer and use it in GitHub Desktop.
Rancher - CATTLE_CLUSTER_REGISTRY vs CATTLE_BASE_REGISTRY

Rancher - CATTLE_CLUSTER_REGISTRY vs CATTLE_BASE_REGISTRY

Rancher's system-default-registry Setting aka CATTLE_BASE_REGISTRY env

The system-default-registry Setting default value comes from CATTLE_BASE_REGISTRY env. In the r/r chart we provide a field systemDefaultRegistry which sets the CATTLE_SYSTEM_DEFAULT_REGISTRY value - this is the auto cattle Env for the setting.

What about CATTLE_CLUSTER_REGISTRY env

This can be found used in 2 domains - first where it is set and used is cattle-cluster-agent-bootstrap deployment. In the cluster agent template we see the Env set to a ClusterRegistry value. This is further traced to GeneratePrivateRegistryEncodedDockerConfig which ultimately fetches the registry from GetPrivateRegistry(cluster). Which finally we find uses the logic of: a) if private registry set on cluster return that, or b) fetch and return SystemDefaultRegistry as URL.

The second place it is used is found within the Rancher agent hot path. The main.go for the agent and various Rancher run methods will utilize this at startup. Ultimately it is stored into ClusterRegistry on the Agents rancher.Options - this is then used by the system chart installer used on downstreams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment