Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

weave-daemonset-k8s.yaml uses image :latest, which isn't multiarch #3974

Open
jpetazzo opened this issue Dec 23, 2022 · 1 comment
Open

weave-daemonset-k8s.yaml uses image :latest, which isn't multiarch #3974

jpetazzo opened this issue Dec 23, 2022 · 1 comment

Comments

@jpetazzo
Copy link

How to reproduce it?

The weave-daemonset-k8s.yaml that was released in October 2022 (see #3960) uses image :latest:.

$ curl -fssL https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml | grep image:
              image: 'weaveworks/weave-kube:latest'
              image: 'weaveworks/weave-kube:latest'
              image: 'weaveworks/weave-npc:latest'

First, this is a bad idea because, to paraphrase Kelsey Hightower, "nobody knows what latest points to".
(This means that if there is ever a new release of Weave, folks using a pinned YAML manifest will be updated to the new release of Weave, which is not what they expect).

Next, unfortunately, image :latest doesn't support arm64 correctly, while image :2.8.1 does:

ubuntu@node1:~$ uname -a
Linux node1 5.15.0-1021-oracle #27-Ubuntu SMP Fri Oct 14 20:04:20 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@node1:~$ sudo docker run --entrypoint sh -ti  weaveworks/weave-kube:latest -c "apk -q add file && file weaver"
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
weaver: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=1a29ea0e5d7e33dcee87512f32068e17dae6f78c, stripped
ubuntu@node1:~$ sudo docker run --entrypoint sh -ti  weaveworks/weave-kube:2.8.1 -c "apk -q add file && file weaver"
weaver: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.7.0, BuildID[sha1]=892358108af8a6f0d0c5427a34943ebfe471b84c, stripped

As a result, installing Weave with that YAML (which is now the "official" YAML linked in the docs) is broken on ARM 😢
(See e.g. #3967)

jpetazzo added a commit to jpetazzo/ampernetacle that referenced this issue Dec 23, 2022
See weaveworks/weave#3974 for details.

I also removed the weave version variable, because it's more likely
that we will expose other ways to set the CNI and that there won't
be new releases of Weave anyway.
@jungin500
Copy link

jungin500 commented Feb 19, 2023

I also faced same issue, and luckily found reasons and workaround (using 2.8.1 version).

I've found out that this is a weaveworks/weave-kube:latest image issue, specifically on the image shown as arm64 architecture in docker hub. Image uploaded to docker hub indicates that the image is arm64 architecture. But, actually binary inside that image is amd64.

Workaround

As a simple fix, changing image tag inside weave-daemonset-k8s.yaml from latest to 2.8.1 works.

You can download changed YAML file here: https://gist.github.com/jungin500/6ca26cc6f8e9b4c16988b50fe43a67f4

Causes

Both images (weaveworks/weave-kube:latest, weaveworks/weave-npc:latest) with architecture arm64 are uploaded on docker hub:

It is likely indicating the arm64 architecture, but actually is not:

$ docker inspect weaveworks/weave-npc@sha256:8cbee41d20340db9d861d94fd1396aca5b0bef569d89360862189414672d013b -f '{{ .Architecture }}'
amd64

$ docker inspect weaveworks/weave-kube@sha256:6b7b1c5bbb0589e6b294324aa3d7ee9316d49203c7c418bf087cbd7982ad62fa -f '{{ .Architecture }}'
amd64

I assume that root cause is misconfigured CI pipeline?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants