Closed vikasgubbi closed 6 years ago
When using this project, you can use docker images from the docker hub or from where ever you want. You specify that in the image. If you dont want to upload an image to eg. the docker hub, you can copy the image to the nodes before deployment. Then the node will already have the image, and use that instead of pulling one from the hub.
Hi,
vikas@ubuntu:~/working$ more mongodb.yaml apiVersion: apps/v1 kind: Deployment metadata: name: mongodb labels: app: mongodb spec: replicas: 3 selector: matchLabels: app: mongodb template: metadata: labels: app: mongodb spec: containers:
vikas@ubuntu:~/working$ kubectl get pods NAME READY STATUS RESTARTS AGE mongodb-5fd8dfd8c6-jhbhn 0/1 ErrImageNeverPull 0 11m mongodb-5fd8dfd8c6-k55m8 0/1 CreateContainerError 0 11m mongodb-5fd8dfd8c6-ldgt4 0/1 CreateContainerError 0 11m mongodb1-6dd5768c5-6t7s4 0/1 ErrImageNeverPull 0 4m mongodb1-6dd5768c5-gflfp 0/1 CreateContainerError 0 4m mongodb1-6dd5768c5-k7xcd 0/1 CreateContainerError 0 4m mongodb2-55dbfd9449-4dqjw 0/1 ImagePullBackOff 0 3m mongodb2-55dbfd9449-5dz5p 0/1 ImagePullBackOff 0 3m mongodb2-55dbfd9449-8tmsx 0/1 ImagePullBackOff 0 3m
Regards,Vikas
How many workers did you make?
Try
kubectl get pods -o wide
Then you can see which node the pod is scheduled on.
Hi,
[vagrant@k8s-worker-2 ~]$ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE mongonew latest f6e11dbc36f9 About a minute ago 437MB weaveworks/weave-npc 2.3.0 21545eb3d6f9 2 months ago 47.2MB weaveworks/weave-kube 2.3.0 f15514acce73 2 months ago 96.8MB gcr.io/google_containers/k8s-dns-sidecar-amd64 1.14.7 db76ee297b85 8 months ago 42MB gcr.io/google_containers/k8s-dns-kube-dns-amd64 1.14.7 5d049a8c4eec 8 months ago 50.3MB gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64 1.14.7 5feec37454f4 8 months ago 41MB gcr.io/google_containers/pause-amd64 3.0 99e59f495ffa 2 years ago 747kB
Events: Type Reason Age From Message
Type Reason Age From Message
Regards,Vikas
Hi,
rephrasing the question
I need to deploy the imported docker image in one node to all the nodes in the cluster, how to do so
Regards,Vikas
If you dont push it to a registry, you will have to import it to all nodes manually. One at the time.
try tagging it with something like vikas/mongodb:4 . Save it, copy it to worker nodes, and import it. Then in your yaml file, reference to it as vikas/mongodb:4.
It should work.
Hi,
Thanks , i will try.
Regards,Vikas
Hi,
How to make use of own private docker registry or export/import of docker image for deployment. Is it possible for both the methods.
Regards,Vikas