How to get Docker Image locally in Kubernetes

82 Views Asked by At

I have K8S cluster on machine(CentOS) which is not connected to internet, I mostly get docker images from the online machines and load like docker load -i myimages.tar.gz and add imagePullPolicy: IfNotPresent in manifest.yaml. It works fine.

Now i am testing Percona XtradbCluster Operator which has imagePullPolicy: Always as i cant change this and i am getting below error

Error: code = Unknown desc = Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:54103->[::1]:53: read: connection refused

How i can make changes on docker or kubernetes so it only get images locally without changing imagePullPolicy?

Update1: I tried to patch statefulset but it didn't work as these resources are directly managed by operator so after my changes operator override it immediately

 kubectl patch statefulset cluster1-pxc -p '{"spec": {"template": {"spec":{"containers":[{"name":"pxc","imagePullPolicy":"Never"}]}}}}' 
0

There are 0 best solutions below