First off, I'm completely new with Kubernetes and I'm having a hard time with the documentation. I'm trying to figure the behavior of the image option in the run command for kubectl.
kubectl run --image=image
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#run
Second, as you can see, the documentation is very clear, but not helpful.
-----------------------------------------------
| Flag | Usage |
-----------------------------------------------
| image | The image for the container to run |
-----------------------------------------------
I can't tell what is the expected behavior here. Can someone tell answer some this for me?
I hope someone can answer this or at least point me to some good documentation or tutorial.
Thanks.
ifNotPresent
. The image may be something simple like nginx:latest
or it might be from your private registry such as myregistry.domain.com/my-ubuntu
or gcr.io/my-project/fancy-new-image
2 & 3. As mentioned above, depends on the policy
Where it is pulling from depends on the image. In many cases, you are specifying a registry and then the image such as my.registry.com/my-image
. Many common images such as nginx
or busybox
will probably come from docker.io, however, you can also change the default registry that docker is using
Yes, your container runtime (usually docker) will need to know which registry to pull from, it will not poll different registry at once.
ECR can be private or public. You will define the ECR registry followed by the image name. ECR will use the following to create the registry name:
The URL for your default registry is https://aws_account_id.dkr.ecr.region.amazonaws.com.
See the AWS documentation for more information on how to use and access images from ECR