Skip to content

containerd can't pull image from Github Docker Package Registry #3291

@csantanapr

Description

@csantanapr

Using the new github docker registry containerd kubernetes can't pull image but using docker engine based k8s works fine.

Steps to reproduce the issue:

  1. Create a secret with github docker registry token
    Follow instructions here:
    https://help.github.com/en/articles/configuring-docker-for-use-with-github-package-registry#authenticating-to-github-package-registry

Using kubectl

kubectl create secret docker-registry regcred --docker-server=https://docker.pkg.github.com --docker-username=<user | org>--docker-password=15650cad4e8a6602284255f7caf76134eb977b45 --docker-email=<email>
  1. Create pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: private-reg
spec:
  containers:
  - name: private-reg-container
    image: docker.pkg.github.com/csantanapr/docker/knative-samples_helloworld-go
  imagePullSecrets:
  - name: regcred
  1. Create a pod
kubectl apply -f pod.yaml

Describe the results you received:
Errors for the Pod pulling image

31s         Normal    Pulling               Pod             pulling image "docker.pkg.github.com/csantanapr/docker/knative-samples_helloworld-go"
31s         Warning   Failed                Pod             Failed to pull image "docker.pkg.github.com/csantanapr/docker/knative-samples_helloworld-go": rpc error: code = Unknown desc = failed to resolve image "docker.pkg.github.com/csantanapr/docker/knative-samples_helloworld-go:latest": no available registry endpoint: docker.pkg.github.com/csantanapr/docker/knative-samples_helloworld-go:latest not found
31s         Warning   Failed                Pod             Error: ErrImagePull
3s          Normal    BackOff               Pod             Back-off pulling image "docker.pkg.github.com/csantanapr/docker/knative-samples_helloworld-go"
3s          Warning   Failed                Pod             Error: ImagePullBackOff

Describe the results you expected:
Pod is in Running State
Here is the output when running same scenario on minikube with docker engine

  Normal  Pulling    2m58s  kubelet, minikube  Pulling image "docker.pkg.github.com/csantanapr/docker/knative-samples_helloworld-go"
  Normal  Pulled     2m48s  kubelet, minikube  Successfully pulled image "docker.pkg.github.com/csantanapr/docker/knative-samples_helloworld-go"
  Normal  Created    2m48s  kubelet, minikube  Created container private-reg-container
  Normal  Started    2m47s  kubelet, minikube  Started container private-reg-container

Output of containerd --version:
I'm running on IKS here is the version 1.2.6 when running kubectl get nodes -o wide

kubectl get nodes -o wide
NAME             STATUS   ROLES    AGE   VERSION       INTERNAL-IP      EXTERNAL-IP      OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
10.187.176.105   Ready    <none>   18d   v1.13.5+IKS   10.187.176.105   169.*.*.*   Ubuntu 18.04.2 LTS   4.15.0-47-generic   containerd://1.2.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/externalIssue in external component being tracked by containerd

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions