ErrImagePull on GitHub private registry

I am new to k8s and trying deploy a daemonset using GitHub Actions. Image was also built using GitHub actions. When it is attempted to deploy Linode Kubernetes through following error:

Failed to pull image "ghcr.io/mazhagiah/cpaas-slproxy:dev": rpc error: code = Unknown desc = failed to pull and unpack image "ghcr.io/mazhagiah/cpaas-slproxy:dev": failed to resolve reference "ghcr.io/mazhagiah/cpaas-slproxy:dev": failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized

Could you help me how to authorize to pull image from ghcr private registry?

2 Replies

HTTP 401 errors occur when your request does not contain the authentication credentials required to access or work with your source repo/registry. You need to make sure that, not only are the package registry's permissions set to allow downloads but that your access token is included in the Kubernetes pull request.

I found some discussion about this issue on the ServerFault and StackOverflow forums on posts that appear to have been marked as "Solved":

Thank you @jhartman

I managed to create secret with GitHub PAT and used it as a default serviceaccount for image pull

Solution partly used from this: https://ryaneschinger.com/blog/using-google-container-registry-gcr-with-minikube/

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct