Cloud Kubernetes cluster cannot pull image from GitHub Private registry but Minikube could pull the same one

Hi All,

I am trying to build an application, but when I try to create a Deployment, the container failed at creation stage with the error:

   "docker.pkg.github.com/XXXXX/XXXXXX/XXXXXXXXXXXX:latest": rpc error: code = NotFound desc = failed to pull and unpack image "docker.pkg.github.com/XXXXX/XXXXXXX/XXXXXXXXXX:latest": failed to copy: httpReaderSeeker: failed open: content at https://docker.pkg.github.com/v2/XXXXXXX/XXXXXX/XXXXXXX/manifests/sha........ not found: not found

I followed exactly along with this tutorial: Pull an Image from a Private Registry | Kubernetes

And I tried with kubectl both on Cloudshell and on my local machine, same issue:

Then I tried minikube on my local machine, and deploy using the YAML, and the deployment created without any issue. Also, docker pull is also working. I guess then it should not be the github credential issue.

I really cannot figure out the reason for kubernetes behave so differently on azure and on minikube. Would appreciate any help on how to troubleshooting and solving this issue.

This no longer an issue. Latest version of AKS on Azure has deprecated Docker as a container runtime (containerD instead). After downgrading the cluster to 1.18, the problem got solved.