Add an easy way to create a Docker config Secret for private image pulling
See original GitHub issueexport const imagePullSecret = new k8s.core.v1.Secret(
"docker-hub",
{
type: "kubernetes.io/dockerconfigjson",
metadata: {
namespace: "community"
},
stringData: {
".dockerconfigjson": config
.requireSecret("docker-hub-token")
.apply(value => {
return JSON.stringify({
auths: {
"https://index.docker.io/v1/": {
auth: value
}
}
})
})
},
},
{
provider: kubernetesProvider
}
);
The above snippet is the current way to create a Secret which can be used to pull private Docker images from Docker Hub. Please provide an easier way to create such a secret.
Context:
Issue created on request of @lblackstone
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Pull an Image from a Private Registry - Kubernetes
This page shows how to create a Pod that uses a Secret to pull an image from a private container image registry or...
Read more >Manage sensitive data with Docker secrets
Create a redis service and grant it access to the secret. By default, the container can access the secret at /run/secrets/<secret_name> , but...
Read more >Creating imagePullSecrets for a specific namespace - IBM
An imagePullSecrets is an authorization token, also known as a secret, that stores Docker credentials that are used for accessing a registry.
Read more >Pull Image from Private Docker Registry in Kubernetes cluster
So how do you pull the application images from your private docker repository on kubernetes cluster? You do that using 2 steps :...
Read more >Pulling private image using Kubernetes Secrets - YouTube
This video shows how to create a Kubernetes Pod that uses a Secret to pull an image from a private Docker registry or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Note for the documentation: the configured Pulumi secret named
docker-hub-token
is actually more than just the personal access token. It should be the base64 encoded version of a string of the form:<username>:<password>
or<username>:<personal access token>
It took me a while to get this right so please add this to the documentation so other people do not have to waste time too.
If you created the registry with pulumi (for example on azure) you can use the outputs from the registry object to generate your secret.
Then call the below function as follows
And to create the secret.