Skip to content

Commit

Permalink
Merge pull request #42329 from dipankardas011/private-repo
Browse files Browse the repository at this point in the history
added Note for secret in same namespace as the Deployment, Pods
  • Loading branch information
k8s-ci-robot committed Oct 10, 2023
2 parents 7675683 + 16fdb34 commit e475bf6
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ docker login
When prompted, enter your Docker ID, and then the credential you want to use (access token,
or the password for your Docker ID).

The login process creates or updates a `config.json` file that holds an authorization token. Review [how Kubernetes interprets this file](/docs/concepts/containers/images#config-json).
The login process creates or updates a `config.json` file that holds an authorization token.
Review [how Kubernetes interprets this file](/docs/concepts/containers/images#config-json).

View the `config.json` file:

Expand All @@ -60,7 +61,8 @@ The output contains a section similar to this:

{{< note >}}
If you use a Docker credentials store, you won't see that `auth` entry but a `credsStore` entry with the name of the store as value.
In that case, you can create a secret directly. See [Create a Secret by providing credentials on the command line](#create-a-secret-by-providing-credentials-on-the-command-line).
In that case, you can create a secret directly.
See [Create a Secret by providing credentials on the command line](#create-a-secret-by-providing-credentials-on-the-command-line).
{{< /note >}}

## Create a Secret based on existing credentials {#registry-secret-existing-credentials}
Expand Down Expand Up @@ -211,7 +213,14 @@ kubectl get pod private-reg
```

{{< note >}}
In case the Pod fails to start with the status `ImagePullBackOff`, view the Pod events:
To use image pull secrets for a Pod (or a Deployment, or other object that
has a pod template that you are using), you need to make sure that the appropriate
Secret does exist in the right namespace. The namespace to use is the same
namespace where you defined the Pod.
{{< /note >}}

Also, in case the Pod fails to start with the status `ImagePullBackOff`, view the Pod events:

```shell
kubectl describe pod private-reg
```
Expand All @@ -229,12 +238,6 @@ Events:
... FailedToRetrieveImagePullSecret ... Unable to retrieve some image pull secrets (<regcred>); attempting to pull the image may not succeed.
```


{{< /note >}}




## {{% heading "whatsnext" %}}

* Learn more about [Secrets](/docs/concepts/configuration/secret/)
Expand Down

0 comments on commit e475bf6

Please sign in to comment.