Search code examples
skaffoldjibgoogle-cloud-codemaven-jib

Skaffold cannot pull image from Harbor


Expected behavior

Skaffold should pull the image from insecure Harbor registry running on HTTP. I have tried everything from these docs:
https://skaffold.dev/docs/environment/image-registries/#insecure-image-registries but without success.

Actual behavior

Jib is pushing image to the insecure Harbor registry without a problem, but error is thrown when trying to pull the image and deploy microservice to Kubernetes:
192.168.2.24:30002/trm/redis-spring:latest@sha256:0f8d21819d845bd55aa699afa8b21e141d41f10d9d9fb1a2c6dbb2d468d89e81 can't be pulled. Specified image can be pulled using docker: docker pull 192.168.2.24:30002/trm/redis-spring:latest@sha256:0f8d21819d845bd55aa699afa8b21e141d41f10d9d9fb1a2c6dbb2d468d89e81

Information

  • Skaffold version: v1.35.1
  • Operating system: Windows 10 Home
  • Installed via: skaffold.dev
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta25
kind: Config
metadata:
  name: redis
build:
  insecureRegistries:
    - 192.168.2.24:30002/trm
    - 192.168.2.24:30002/trm/redis-spring
    - 192.168.2.24:30002/trm/redis-spring:latest@sha256:0f8d21819d845bd55aa699afa8b21e141d41f10d9d9fb1a2c6dbb2d468d89e81
  artifacts:
    - image: redis-spring
      jib:
        args:
          - -Pjib
          - -DsendCredentialsOverHttp=true
  tagPolicy:
    gitCommit: {}
deploy:
  kubectl:
    manifests:
      - redis-spring-boot.yaml
time="2022-02-02T11:12:40+01:00" level=debug msg="marking resource failed due to error code STATUSCHECK_IMAGE_PULL_ERR" subtask=-1 task=Deploy
 - mdm-dev:deployment/redis-spring-boot: container redis-spring is waiting to start: 192.168.2.24:30002/trm/redis-spring:latest@sha256:0f8d21819d845bd55aa699afa8b21e141d41f10d9d9fb1a2c6dbb2d468d89e81 can't be pulled
    - mdm-dev:pod/redis-spring-boot-68ccfdc688-tj7pp: container redis-spring is waiting to start: 192.168.2.24:30002/trm/redis-spring:latest@sha256:0f8d21819d845bd55aa699afa8b21e141d41f10d9d9fb1a2c6dbb2d468d89e81 can't be pulled
 - mdm-dev:deployment/redis-spring-boot failed. Error: container redis-spring is waiting to start: 192.168.2.24:30002/trm/redis-spring:latest@sha256:0f8d21819d845bd55aa699afa8b21e141d41f10d9d9fb1a2c6dbb2d468d89e81 can't be pulled.
time="2022-02-02T11:12:40+01:00" level=debug msg="setting skaffold deploy status to STATUSCHECK_IMAGE_PULL_ERR." subtask=-1 task=Deploy```

Solution

  • You need to configure a registry pull secret for your cluster, and then either annotate your pod-specs or your service account to use this registry pull secret.