Troubleshooting Failed to pull image error Kubernetes

1.2k Views Asked by At

So I have a private repository setup in docker which has an image which needs to be pulled by kubernetes.

When I browse http://localhost:5000/v2/imagename/tags/list I can see a json with the image and its respective tag (FYI: I am using kind and helm to spin up the k8 pods in a windows machine).

No matter what I try I end up with the following error:

Failed to pull image "localhost:5000/imagename:1.0.0": rpc error: code = Unknown desc = failed to pull and unpack image "localhost:5000/imagename:1.0.0": failed to resolve reference "localhost:5000/cube-airflow:1.0.0": failed to do request: Head http://localhost:5000/v2/imagename/manifests/1.0.0: dial tcp [::1]:5000: connect: connection refused

How do I troubleshoot an image can be pulled via kubernetes properly? Is there a kubectl command that can do that?

This is my deployment template:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
  - |-
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry:5000"]
      endpoint = ["http://registry:5000"]
nodes:
- role: control-plane
- role: worker
  kubeadmConfigPatches:
  - |
    kind: JoinConfiguration
    nodeRegistration:
      kubeletExtraArgs:
        node-labels: "has-cpu=true"
- role: worker
  kubeadmConfigPatches:
  - |
    kind: JoinConfiguration
    nodeRegistration:
      kubeletExtraArgs:
        node-labels: "has-gpu=true"

I am trying to deploy a custom docker image for airflow in Kubernetes using its helm chart.

0

There are 0 best solutions below