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:

    1. 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.

    1. Add the imagePullSecrets to your default service account in the namespace.

    2. 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.