I created an AWS AMI with docker and my image preloaded (docker image is 7 gigs and it takes too long to download from private registry). I am using Rancher and have set my node template to use this ami. When I run my
kubectl create -f command
I get the error that the image is not present and I don't have pull permissions. When I then ssh into the EC2 node and run
docker images
Only Rancher images show up. I know that the docker file is present with the AMI as I have launched separate instances outside of Kubernetes and have proved to myself that the docker image is present. I notice when spinning up the cluster through the Rancher UI that it appears that Docker is being reinstalled on the nodes which I believe is removing the docker image.
When you say ssh into the EC2 instance
, I believe you checked in the node where the pod is running and not in the master.
Also kindly check if the image pull policy is set to Never
or IfNotPresent
in your yaml file.
imagePullPolicy: Never