1

I have a single-node k8s server.

I want to run a k8s pod from a .tar.gz file.

I do this:

$ docker load -i myapp.tar.gz

and I verify it with:

$ docker images
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
myapp        1.0     f6b7a8b41894   2 months ago     33MB

I have a values.yaml file:

myapp:
  myapp:
    image: "myapp:1.0"
    imagePullPolicy: IfNotPresent
    ifname: eth0
    resources:
      limits:
        cpu: 100m
        memory: 128Mi
      requests:
        cpu: 100m
        memory: 128Mi
    autoscale:
      minReplicas: 1
      maxReplicas: 2
      targetCPUUtilizationPercentage: 90

and I install it with Helm.

and then I check the deployed pod:

$ kubectl get pods -A

and I see ImagePullBackOff error. When I describe the pod, I get this error:

  Normal   Scheduled  3m17s                 default-scheduler  Successfully assigned cs1/myapp-7589554bd4-4pprj to masternode1
  Normal   Pulling    100s (x4 over 3m16s)  kubelet            Pulling image "myapp:1.0"
  Warning  Failed     99s (x4 over 3m14s)   kubelet            Failed to pull image "myapp:1.0": rpc error: code = Unknown desc = failed to pull and unpack image "docker.io/library/myapp:1.0": failed to resolve reference "docker.io/library/myapp:1.0": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

Any idea how can I resolve this issue?

mcqueenvh
  • 31
  • 2
  • Just a guess. Try to set repository URL as localhost: `docker tag f6b7a8b41894 localhost/myapp:latest` and set `image: "localhost/myapp"` inside yaml – rzlvmp Jul 07 '22 at 14:46
  • Does this answer your question? [Pull a local image to run a pod in Kubernetes](https://stackoverflow.com/questions/40144138/pull-a-local-image-to-run-a-pod-in-kubernetes) – rock'n rolla Jul 07 '22 at 14:57
  • Solved the problem by installing a local registry in Docker: https://docs.docker.com/registry/deploying/ – mcqueenvh Jul 11 '22 at 09:34

0 Answers0