2

我使用 docker-desktop for mac 进行了简单的设置,并附带了 Kubernetes 集群。

每次我运行skaffold dev, with 时imagePullPolicy: Never,都会创建一个映像,但在将脏映像部署到 Kubernetes 集群时仍然出现错误:

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

谁能帮我调试一下?我不知道如何进一步调查。但是skaffold没有将我的脏镜像部署到 Kubernetes 集群。每个人都建议添加imagePullPolicy: Never到我的deployment.yaml,但这并不能解决任何问题

skaffold.yml 内容:

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
4

1 回答 1

2

我唯一能想到的是您skaffold.yaml的图像名称与图像名称不匹配:

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

否则,您的 docker + K8s 实例可能会损坏某些内容。你可以试试:

  • 在 Docker 中启用/禁用 K8s
  • 使用种类
于 2020-07-14T05:32:20.487 回答