Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Kubernetes: Pull an Image from a Private Registry using Yaml and Helm File

Method 1 – Change docker config default registry

To change the default registry for Docker to a private registry that requires authentication, you can follow these steps:

  1. Create or edit the /etc/docker/daemon.json file on your Docker host machine.
  2. Add the following lines to the file, replacing your-registry with the URL of your private registry and your-username and your-password with your registry credentials:
{
  "auths": {
    "your-registry": {
      "auth": "your-username:your-password"
    }
  },
  "registry-mirrors": ["https://your-registry"]
}

Note that the auths key is used to specify the credentials for your private registry, and the registry-mirrors key is used to specify the URL of the registry.

  1. Save the file and exit.
  2. Restart the Docker daemon to apply the changes:
$ sudo systemctl restart docker
  1. Verify that the configuration has been applied by running the docker info command. You should see the URL of your registry listed under “Registry Mirrors”.
$ docker info
...
Registry Mirrors:
  https://your-registry/
...

With this configuration, Docker will use your private registry as the default registry for pulling images and will authenticate with your registry credentials.

Method 2 – Create a Secret based on existing credentials using in Pod Spec

Method 3 – Create a Secret based on existing credentials using Helm chart

  • https://stackoverflow.com/questions/49669077/helm-chart-deployment-and-private-docker-repository

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Kubernetes Job & CronJob Explained: API Resource, YAML Example, and Use Cases

Kubernetes Jobs and CronJobs Explained with Examples: Complete Hands-on Guide for DevOps Engineer Keywords 1. Introduction In Kubernetes, not every workload is a long-running application like a…

Read More

Kubernetes Secret Explained: Secret API Resource, YAML Example, and Use Cases

What is Kubernetes SecretsA Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Objects of…

Read More

Kubernetes ConfigMap Explained: API Resource, YAML Example, and Use Cases

Content of reverseproxy.conf Commands to execute to create configmap Example pod using configmap Validating configmap inside a pod Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps,…

Read More

Kubernetes Service Explained: API Resource, YAML Example, and Use Cases

In Kubernetes, a Service is an abstraction that defines a logical set of pods and a policy by which to access them. It provides a stable network…

Read More

Kubernetes Deployment Explained: API Resource, YAML Example, and Use Cases

Fearture of Kubernetes Deployment Note:ReplicaSets = Replication+Controller in the Deployment Kubernetes Deployement Strategy Type of deployment .spec.strategy specifies the strategy used to replace old Pods by new…

Read More

Kubernetes ReplicaSet Explained: API Resource, YAML Example, and Use Cases

Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have…

Read More
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Jeroen
Jeroen
3 years ago

Good advice!

drad
drad
3 years ago

Your first method (using the daemon.json) is interesting but does not seem to work as docker crashes after a restart. Are you certain that the auths section is correct?

2
0
Would love your thoughts, please comment.x
()
x