Deploying images from a private container registry
To share access to your private container images across multiple services and revisions, you create a list of Kubernetes secrets () using your registry credentials, add that imagePullSecrets
to your default , and then deploy those configurations to your Knative cluster.
You need:
- A Kubernetes cluster with Knative Serving installed.
Create a
imagePullSecrets
that contains your credentials as a list of secrets:Where
[REGISTRY-CRED-SECRETS]
is the name that you want for your secrets (imagePullSecrets
object). For example,container-registry
.-
Examples:
- Google Container Registry:
[PRIVATE_REGISTRY_EMAIL]
is your email address that is associated with the private registry.[PRIVATE_REGISTRY_USER]
is the username that you use to access the private container registry.[PRIVATE_REGISTRY_PASSWORD]
is the password that you use to access the private container registry.
Add the
imagePullSecrets
to yourdefault
service account in the namespace.Deploy the updated service account to your Knative cluster:
Now, all the new pods that are created in the default
namespace will include your credentials and have access to your container images in the private registry.
You can now create a service that uses your container images from the private registry. Learn how to create a Knative service.