Understanding Image Names
Consider the following simple pod definition file:Image Registries
When an image location is not explicitly specified, Kubernetes assumes that the image is pulled from Docker Hub (with the DNS name docker.io). Registries serve as image stores—every time you create or update an image, you push it to a registry. These images are later pulled from the registry for application deployment. There are numerous popular registries available. For instance, Google’s container registry (gcr.io) hosts many Kubernetes-related images, including those used for cluster end-to-end tests. While these images are publicly accessible, internal applications often require a private registry to maintain security. For example, consider these image names:Accessing Private Registries
To run a container using a private image, first authenticate with the private registry using thedocker login command:
Creating a Kubernetes Secret for Docker Registry
To securely store your registry credentials, create a secret of type Docker registry. Follow these steps:-
Authenticate against your private registry:
-
Create a Kubernetes secret that stores these credentials:
-
Update your pod definition to include the secret under the
imagePullSecretssection: