Registries are secrets containing credentials used to authenticate with private registries. Deployments use these secrets to authenticate with a private registry and then pull a Docker image hosted on it.

Currently, credentials are pulled automatically only if the workload is created in the Rancher UI and not when it is created via kubectl.

Prerequisites: You must have a private registry available to use.

  1. From the Global view, select the project containing the namespace(s) where you want to add a registry.

  2. From the main menu, select Resources > Registries. Click Add Registry.

  3. Enter a Name for the registry.

    Note: Kubernetes classifies secrets, certificates, ConfigMaps, and registries all as secrets, and no two secrets in a project or namespace can have duplicate names. Therefore, to prevent conflicts, your registry must have a unique name among all secrets within your workspace.

  4. Select a Scope for the registry. You can either make the registry available for the entire project or a single namespace.

  5. Select the website that hosts your private registry. Then enter credentials that authenticate with the registry.

  6. Click Save.

Result: Your secret is added to the project or namespace, depending on the scope you chose. You can view the secret in the Rancher UI from the Resources > Registries view.

What’s Next?

Now that you have a registry added to the project or namespace, you can add it to a workload that’s deploying an image from your private registry.

For more information on adding a registry to a workload, see Deploying Workloads.