From 18e15fc07ca73478d436615cebfe03981a4d8e02 Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Tue, 7 Sep 2021 17:03:18 +0100 Subject: [PATCH] Delete duplicate deploying-from-private-registry.md file (#4146) * Delete deploying-from-private-registry.md * Add back a change from the deleted version of the file * Fix broken link --- .../operator/configuring-serving-cr.md | 2 +- .../deploying-from-private-registry.md | 2 +- .../deploying-from-private-registry.md | 87 ------------------- 3 files changed, 2 insertions(+), 89 deletions(-) delete mode 100644 docs/serving/deploying-from-private-registry.md diff --git a/docs/admin/install/operator/configuring-serving-cr.md b/docs/admin/install/operator/configuring-serving-cr.md index f9d3d1ae0..c2de5f05b 100644 --- a/docs/admin/install/operator/configuring-serving-cr.md +++ b/docs/admin/install/operator/configuring-serving-cr.md @@ -112,7 +112,7 @@ location. This section is only needed when the registry images do not match the - `imagePullSecrets`: a list of Secret names used when pulling Knative container images. The Secrets must be created in the same namespace as the Knative Serving Deployments. See [deploying images -from a private container registry](../../../serving/deploying-from-private-registry.md) for configuration details. +from a private container registry](../../../developer/serving/deploying-from-private-registry.md) for configuration details. ### Download images in a predefined format without secrets: diff --git a/docs/developer/serving/deploying-from-private-registry.md b/docs/developer/serving/deploying-from-private-registry.md index ac9cd06d5..988b2e2b7 100644 --- a/docs/developer/serving/deploying-from-private-registry.md +++ b/docs/developer/serving/deploying-from-private-registry.md @@ -44,7 +44,7 @@ To configure using a private container registry, you must: Example: ```bash - kubectl create secret container-registry \ + kubectl create secret docker-registry container-registry \ --docker-server=https://gcr.io/ \ --docker-email=my-account-email@address.com \ --docker-username=my-grc-username \ diff --git a/docs/serving/deploying-from-private-registry.md b/docs/serving/deploying-from-private-registry.md deleted file mode 100644 index 597545a86..000000000 --- a/docs/serving/deploying-from-private-registry.md +++ /dev/null @@ -1,87 +0,0 @@ -# Deploying images from a private container registry - -Learn how to configure your Knative cluster to deploy 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 -([`imagePullSecrets`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#pod-v1-core)) -using your registry credentials, add that `imagePullSecrets` to your default -[service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/), -and then deploy those configurations to your Knative cluster. - -## Before you begin - -You need: - -- A Kubernetes cluster with [Knative Serving installed](../admin/install/serving/install-serving-with-yaml.md). -- The credentials to the private container registry where your container images are stored. - -## Configuring your credentials in Knative - -1. Create a `imagePullSecrets` that contains your credentials as a list of secrets: - - ```bash - kubectl create secret docker-registry [REGISTRY-CRED-SECRETS] \ - --docker-server=[PRIVATE_REGISTRY_SERVER_URL] \ - --docker-email=[PRIVATE_REGISTRY_EMAIL] \ - --docker-username=[PRIVATE_REGISTRY_USER] \ - --docker-password=[PRIVATE_REGISTRY_PASSWORD] - ``` - - Where - - `[REGISTRY-CRED-SECRETS]` is the name that you want for your secrets - (`imagePullSecrets` object). For example, `container-registry`. - - - `[PRIVATE_REGISTRY_SERVER_URL]` is the URL to the private - registry where your container images are stored. - - Examples: - - Google Container Registry: [https://gcr.io/](https://gcr.io/) - - DockerHub [https://docker.io/](https://docker.io/) - - * `[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. - - Example: - - ```bash - kubectl create secret docker-registry `container-registry` \ - --docker-server=https://gcr.io/ \ - --docker-email=my-account-email@address.com \ - --docker-username=my-grc-username \ - --docker-password=my-gcr-password - ``` - - Tip: After creating the `imagePullSecrets`, you can view those secret's by running: - - ```bash - kubectl get secret [REGISTRY-CRED-SECRETS] --output=yaml - ``` - -1. Add the `imagePullSecrets` to your `default` service account in the - `default` namespace. - - Note: By default, the `default` service account in each of the - [namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) - of your Knative cluster are use by your revisions unless [`serviceAccountName`](https://github.com/knative/specs/blob/main/specs/serving/knative-api-specification-1.0.md#revision-2) is specified. - - Run the following command to modify your `default` service account, assuming - you named your secrets `container-registry`: - - ```bash - kubectl patch serviceaccount default -p "{\"imagePullSecrets\": [{\"name\": \"container-registry\"}]}" - ``` - -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. - -## What's next - -[Learn how to create a Knative service](getting-started-knative-app.md).