0

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.

vkandvia
  • 85
  • 12
  • 1
    Can you add your deployment yaml template in your question? – Daniel Marques May 11 '21 at 11:35
  • 1
    using kind and Docker for windows, I'd avoid using localhost in your calls. The way the networking works for them, that's not likely to be successful. If you want to troubleshoot this, I'd get a shell in the kind node with `docker exec -it kind-control-plane /bin/bash` then use curl to check from there. – Rory McCune May 11 '21 at 13:24
  • 1
    Thanks @RoryMcCune! All my configurations were in place but the company firewall was blocking kubernetes from pulling the image. I was able to figure it out when trying to do a curl of the docker image metadata. – vkandvia May 12 '21 at 06:16

0 Answers0