Authenticating in a container registry
If the image you need for a task is located in a private registry, you can use an image pull secret to add your credentials to the service account that downloads the images.
To do so, you first need to create a set of credentials in your Kubernetes cluster. You can do this with the kubectl
CLI tool with the following command to create an object of kind Secret
called registry-creds
:
$ kubectl create secret docker-registry registry-creds --docker-server=<server> --docker-username=<username> --docker-password=<password --docker-email=<email>
Note
Here, replace server
, username
, password
, and email
with the matching values for your registry.
Next, you will need to create a new service account for your cluster. You can do this using the following YAML. This service account, called authenticated
, will use the newly created registry-creds
to authenticate to the image registry. You can name this file...