kubernetes-sigs / prometheus-adapter

An implementation of the custom.metrics.k8s.io API using Prometheus
Apache License 2.0
1.9k stars 551 forks source link

When pulling arm64 image I get an amd64 one #600

Closed hmonsalv closed 1 year ago

hmonsalv commented 1 year ago

What happened?: the docker manifest registry.k8s.io/prometheus-adapter/prometheus-adapter:v0.11.0 apparently has linux/arm64 support:

{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 2403,
"digest": "sha256:f7a904c3c7055eff990a1b9a2177d8053a680028a323bb82ca2790f3e2d7a9d9",
"platform": {
"architecture": "arm64",
"os": "linux"
}
}

But when pulling linux/arm64 image, I am getting an image with amd64 architecture instead. I tested it for both v0.10.0 and v0.11.0:

❯ docker pull registry.k8s.io/prometheus-adapter/prometheus-adapter:v0.11.0 --platform arm64
...
❯ docker image inspect registry.k8s.io/prometheus-adapter/prometheus-adapter:v0.11.0 | jq -r ".[0].Architecture"
amd64

What did you expect to happen?: get the arm64 image. This is working fine for other images in same registry, e.g.:

❯ docker pull registry.k8s.io/pause:3.6 --platform arm64
...
❯ docker image inspect registry.k8s.io/pause:3.6 | jq -r ".[0].Architecture"
arm64

Could it be that the docker manifest reference to the linux/arm64 is wrongly pointing to an linux/amd64 one?

Thanks a lot in advance! Kind regards.

dgrisonnet commented 1 year ago

/triage accepted

dgrisonnet commented 1 year ago

Thank you for the report @hmonsalv, there was something wrong with the way I built the multi arch images. The PR I opened should've fixed the issue. There is currently a job in progress that will publish new staging images https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/post-prometheus-adapter-push-images/1694021319764480000. Once it is done and I have verified that the image have now the correct architecture, I will work on a new release of prometheus-adapter.

hmonsalv commented 1 year ago

Thanks Damien! Will this new patch release be back ported to v.0.10? When do you estimate it will be available?

dgrisonnet commented 1 year ago

Yes I can backport it. Either today or tomorrow

dgrisonnet commented 1 year ago

@hmonsalv release v0.10.1 is now available

hmonsalv commented 1 year ago

@dgrisonnet would it be possible to back port the fix also to v0.9 and create a v0.9.2? Thanks in advance!

dgrisonnet commented 1 year ago

v0.9.1 is already 2 years old which means that is using an unsupported version of Kubernetes and golang, so I'd rather have you update to v0.10.1.

hmonsalv commented 1 year ago

We did already for our actual cluster stack where we bumped to v0.10.1. But due to some qa and compliance we still need to provide support for a few more months to our old stack where we used v0.9.1. It would be awesome to have the v0.9.2 with arm64 🙏

dgrisonnet commented 1 year ago

I can backport the fix which will build a staging image that you can use, but I won't do a v0.9.2 release, is that fine with you?