skip to Main Content

When my yaml is something like this :

apiVersion: v1
kind: Pod
metadata:
  name: task-pv-pod
spec:
  volumes:
    - name: task-pv-storage
      persistentVolumeClaim:
        claimName: task-pv-claim
  containers:
    - name: task-pv-container
      image: nginx
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
        - mountPath: "/usr/share/nginx/html"
          name: task-pv-storage

Where is the nginx image coming from? for e.g. in GKE Kubernetes world, if I was going to reference an image from registry it’s normally something like this:

image: gsr.io.foo/nginx

but in this case it’s just an image name:

image: nginx

So trying to just understand where the source registry is on when deployed on a K8 cluster as it seems to pull down ok but just want to know how I can figure out where it’s supposed to come from?

2

Answers


  1. Chosen as BEST ANSWER

    OK, I was able to specifically confirm from my node based on the container runtime:

    1. If your nodepool is running docker, you may run docker system info and look for the image being pulled from mirror.gcr.io.
    2. If your nodepool is running containerd, you may run sudo crictl info and look for the same as above.

  2. It’s coming from docker hub (https://hub.docker.com/) when only image name is specified in the manifest file. Example:

    ...
    Containers:
      - name: nginx
        image: nginx
    ...
    

    For nginx, it’s coming from official nginx repository (https://hub.docker.com/_/nginx).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search