Cosmin Atanasiu
Cosmin Atanasiu

Reputation: 2654

Skaffold not working with local docker image & docker-desktop kubernetes

I have a simple setup with docker-desktop for mac, with the Kubernetes cluster that comes with it.

Every time I run skaffold dev, with imagePullPolicy: Never, an image gets created, but I still get an error when deploying the dirty image to the Kubernetes cluster:

ErrImageNeverPull: Container image "user/test:bf13343a4b431df2b7df84f58ede9229bd3d868a4b10147fff04eae8a7adc0cd" is not present with pull policy of Never

Can anyone help me debug this? I have no idea how to investigate this further. But skaffold is not deploying my dirty image to the Kubernetes cluster. And everyone is suggesting adding imagePullPolicy: Never to my deployment.yaml but that doesn't fix anything

The skaffold.yml content:

apiVersion: skaffold/v2beta5
kind: Config
metadata:
  name: test
build:
  artifacts:
  - image: user/test
deploy:
  kubectl:
    manifests:
    - kube/postgres/postgres-configmap.dev.yaml
    - kube/redis/redis-configmap.secret.yaml
    - kube/web/web-configmap.dev.yaml
    - kube/elasticsearch/elasticsearch-storage.dev.yaml
    - kube/postgres/postgres-storage.dev.yaml
    - kube/cable/cable-service.yaml
    - kube/dashboard.yaml
    - kube/cable/cable-deployment.yaml
    - kube/nginx/load-balancer.dev.yaml
    - kube/redis/redis-storage.yaml
    - kube/sidekiq/sidekiq-deployment.yaml
    - kube/web/web-deployment.yaml
    - kube/web/web-service.dev.yaml
    - kube/web/web-migration.yaml
    - kube/web/web-seed.yaml

Upvotes: 3

Views: 6971

Answers (1)

Rico
Rico

Reputation: 61571

The only thing I can think of is that your skaffold.yaml doesn't match the image name:

apiVersion: skaffold/v2beta5
kind: Config
build:
  artifacts:
  - image: user/test 👈 does this match?
deploy:
  kubectl:
    manifests:
      - deployment.yaml

Otherwise, something might be corrupted with your docker + K8s instance. You can try:

  • Enable/Disable K8s in Docker
  • Use KinD

Upvotes: 2

Related Questions