Skip to content

502 Bad gateway when harbor-core starts up #21739

@waddles

Description

@waddles

When harbor-core pods start up, the first attempt to fetch an image proxied to ECR results in a 502 Bad gateway. Subsequent requests succeed without error but this occurs fairly regularly with busy harbor deployments when autoscaling is configured.

Kubernetes event logs for the client look like this

Failed to create pod sandbox: rpc error: code = Unknown desc = failed to get sandbox image \
"123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/eks/pause:3.5": failed to pull image \
"123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/eks/pause:3.5": failed to pull and unpack image \
"123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/eks/pause:3.5": failed to resolve reference \
"123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/eks/pause:3.5": unexpected status from HEAD request \
to https://harbor.example.com/v2/1234566789012.dkr.ecr.ap-southeast-2.amazonaws.com/eks/pause/manifests/3.5?ns=123456789012.dkr.ecr.ap-southeast-2.amazonaws.com: 502 Bad Gateway

There are no relevant logs from the harbor-core pods but I think it is fetching a token before querying ECR.

Steps to reproduce the problem:

  1. Configure a registry mirror for ECR in harbor
  2. Configure containerd on clients to request ECR images via harbor proxy
  3. Restart or scale up harbor-core pods

Versions:

  • harbor version: v2.12.0-9da38ae0
  • containerd version: 1.7.23

Additional context:
I have tried changing the startupProbe to use /api/v2.0/health instead of /api/v2.0/ping but that made no difference.

Metadata

Metadata

Labels

Stalekind/questionmore-info-neededThe issue author need to provide more details and context to the issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions