Unable to pull public docker image packages from GitHub through Kubernetes

5/28/2020

I created a sample Node.js project in GitHub and created a docker image for the same. I uploaded the docker image as a package in the same repository. This is a public repo. I created a kubernetes config yaml file with this image as the pods image. Following is the yaml file

apiVersion: apps/v1
kind: Deployment
metadata:
  name: server-deployment
spec:
  selector:
    matchLabels:
      component: node-server
  template:
    metadata:
      labels:
        component: node-server
    spec:
      containers:
        - name: node-server
          image: docker.pkg.github.com/lethalbrains/intense_omega/io_service:latest
          ports:
            - containerPort: 3000
      imagePullSecrets:
        - name: dockerconfigjson-github-com
---
apiVersion: v1
kind: Service
metadata:
  name: server-cluster-ip-service
spec:
  selector:
    component: node-server
  ports:
    - port: 3000
      targetPort: 3000
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/inress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - http:
        paths:
          - path: /api/
            backend:
              serviceName: server-cluster-ip-service
              servicePort: 3000 

After I apply this file using Kubectl and check the pods details, I get an ImagePullBackOff error.

enter image description here

I even tried using this option of using dockerconfigjson secret with Github Personal Access Token but still the sam result.

Edit:

Added error message from pods describe enter image description here

-- Rahul
continuous-integration
docker
github
kubernetes

0 Answers