How to create a local docker registry in my kubernates cluster then I can load my local docker image in my yaml file?
Please help me
You can deploy the Docker Registry Docker Hub.
I have not personally tested them all, but there are many tutorials (like this one Deploy Your Private Docker Registry as a Pod in Kubernetes | by Varun Kumar G | The Startup | Medium) available.
Thank you for your help…
I follow instructions in the link
And finally succeed to build local docker image,
Now I have another problem when I change configuration file
And rebuild docker image again I can’t pull image for previous assigned worker node
And I must choose new worker node in kubernate which I didn’t assign pode before
With previous docker image
Again thanks for your help
Can you provide a little more detail on your problem (and about your cluster’s configuration)?
You’ve been able to deploy a local registry in your kubernetes cluster .
image-v1 and you push it to your registry running in your container.
You deploy some application based on your
image:v1 by running
kubectl apply -f someapp.yml. Your application is deployed and runs ok on your cluster.
I don’t understand the part about choosing the node to assign the pod.
Let’s say that you have 2 worker nodes in your cluster. If your initial replica count is 1, the pod is deployed on, say,
node1. If you scale your deployment to
replicas=2, the default behaviour would be to spread the pods, so the second pod will be deployed to
node2 (unless you are assigning pods to specific nodes: Assigning Pods to Nodes.
If you build a new version of the base image, say
image:v2, you repeat the steps above:
- push the
image:v2to the registry running in your kubernetes cluster
- update your deployment file (
someapp-v2.yml) to use
kubectl apply -f someapp-v2.yml
Kubernetes will replace the pods (based on
image:v1) and run new ones (based on
image:v2). See Updating a Deployment.
Can you detail the steps you take?
I dedicate a service and demonstration.apps in yaml file. When I assign a label to node and then select node according to node label in yaml file for first image for example image:v1 every thing is OK and pulling done successfully . But for second time when I rebuild image for example image:v2 pulling error happens…
What should I do, several deployment needed ?