Skip to Content

Find image registry in Kubernetes

In Kubernetes, when you deploy workloads using container images, the images are typically pulled from a container image registry specified in the deployment configuration.

To check which image registry is being used by your containers in Kubernetes, you need to inspect the image field in the pod specifications of your deployments, stateful sets, daemon sets, or any other workload resource that you’re using.

Here’s how you can check the container image registry for your Kubernetes workloads:

Get the List of Running Pods

First, list all the running pods in your Kubernetes cluster or in a specific namespace:

Get Your Free Linux training!

Join our free Linux training and discover the power of open-source technology. Enhance your skills and boost your career! Learn Linux for Free!
# List all pods in all namespaces
kubectl get pods --all-namespaces

# List all pods in a specific namespace
kubectl get pods -n <namespace>

Describe a Pod to View Its Configuration

Pick a pod from the list and describe it to view its configuration, including the container image paths:

kubectl describe pod <pod-name> -n <namespace>

In the pod description, look for the Containers section. You will see the Image: field, which specifies the container image being used by the pod. The image name typically includes the registry’s URL as a prefix, followed by the image name and tag. For example:

  • docker.io/library/nginx:latest indicates an image pulled from Docker Hub’s official nginx repository.
  • gcr.io/my-project/my-app:1.2.3 indicates an image pulled from Google Container Registry for the project my-project.

Inspect Deployment or Other Workload Resources

You can also inspect the deployment or other workload resources directly to see which image they are configured to use:

# For deployments
kubectl get deployment <deployment-name> -n <namespace> -o yaml

# For stateful sets
kubectl get statefulset <statefulset-name> -n <namespace> -o yaml

# For daemon sets
kubectl get daemonset <daemonset-name> -n <namespace> -o yaml

Look for the image: field under the containers section in the output. This will show you the full path of the image being used, which includes the registry’s URL.

Using Kubernetes Dashboard

If you have the Kubernetes Dashboard installed, you can also use it to inspect workloads and see the container images being used. Navigate to the workload (e.g., Deployments, StatefulSets) and click on a specific instance to view its details, including the container images.

Notes

  • If the image path doesn’t include a registry URL, it means the default Docker Hub registry is being used.
  • Private registries often require credentials to pull images. These credentials are typically stored in Kubernetes as secrets and referenced in the workload’s pod specification.
  • Remember that the actual pulling of images from the registry is done by the nodes’ container runtime, and Kubernetes just tells the runtime which images to pull based on the workload configurations.

By following these steps, you can easily determine which container image registry is being used by your Kubernetes workloads.