'How do I pull a Github (ghcr.io) from Minikube?

I run

docker pull ghcr.io/.../test-service

Everything works just fine, however, when I try to use it in a deployment and apply the deployment to a Minikube instance I get...

Warning  Failed     14s (x4 over 93s)  kubelet            Error: ErrImagePull
Normal   BackOff    1s (x6 over 92s)   kubelet            Back-off pulling image "ghcr.io/.../test-service:latest"
Warning  Failed     1s (x6 over 92s)   kubelet            Error: ImagePullBackOff

How do I configure Minikube to use my Github PAT?

My deployment looks like this...

apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-app
  namespace: foo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: test-app
      version: v1
  template:
    metadata:
      labels:
        app: test-app
        version: v1
    spec:
      serviceAccountName: test-app
      containers:
      - image: ghcr.io/.../test-service:latest
        imagePullPolicy: Always
        name: test-app
        ports:
        - containerPort: 8000


Solution 1:[1]

It's because you did not create a docker registry secret. To do so, you can follow https://dev.to/asizikov/using-github-container-registry-with-kubernetes-38fb

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 behanzin777