dockerkubernetesskaffold

Skaffold Error: deployment failed because of cleaning up


I have tried so many times to run skaffold from my project directory. It keeps me returning the same error: 1/1 deployment(s) failed

deployment and service creates or configures but Waiting for deployments to stabilize... in here it gives message deployment/auth-depl failed. Error: container auth is waiting to start: toufiqurr/auth:032c18c37052fbb11c28f36414f079c0562dcea8fd96070a55ecd98d31060fdb can't be pulled.

Skaffold.yaml file:

apiVersion: skaffold/v2alpha3
kind: Config
deploy:
  kubectl:
    manifests:
      - ./infra/k8s/*
build:
  local:
    push: false
  artifacts:
    - image: ankan00/auth
      context: auth
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .

Created a docker image of ankan00/auth by docker build -t ankan00/auth .

It ran successfully when I was working with this project. But I had to uninstall docker for some reason and then when I reinstalled docker built the image again(after deleting the previous instance of the image in docker desktop), then skaffold is not working anymore. I tried to delete skaffold folder and reinstall skaffold but the problem remains the same. Everytime it ends up in cleaning up and throwing 1/1 deployment(s) failed.

My Dockerfile:

FROM node:alpine

WORKDIR /app
COPY package.json .
RUN npm install 
COPY . . 

CMD ["npm", "start"]

my auth-depl.yaml file which is in infra\k8s directory

apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auth
  template:
    metadata:
      labels:
        app: auth
    spec:
      containers:
        - name: auth
          image: ankan00/auth
---
apiVersion: v1
kind: Service
metadata:
  name: auth-srv
spec:
  selector:
    app: auth
  ports:
    - name: auth
      protocol: TCP
      port: 3000
      targetPort: 3000

Solution

  • Okay! I resolved the isses by re-installing the docker desktop and not enabling Kubernetes in it. I installed Minikube and then I ran skaffold dev and this time it was not giving error in deployments to stabilize... stage. Looks like Kubernetes desktop is the culprit? I am not sure though because I ran it successfully before.

    New Update!!! I worked again on the Kubernetes desktop. I deleted Minikube because Minicube uses the same port that the ingress-Nginx server uses to run the project. So, I had decided to put back Kubernetes desktop, also Google cloud Kubernetes engine. And scaffold works perfectly this time.