aojea / kindnet

minimalistic Kubernetes network plugin
118 stars 16 forks source link

kindnet for linux/arm64 #33

Closed hellt closed 1 week ago

hellt commented 2 weeks ago

Hi @aojea long time no see, we are starting to have more users trying to run networking topologies with kind and kindnet as a proper CNI suitable for networking OSes.

Unfortunately, we have a lot of Mac Os users (me included), who wanted to play with this on their macs. Would it be possible to build kindnet for linux/arm64 so that we get to enjoy kind clusters with it?

Should be a few lines in the workflow config, but this is sensitive for outside contributions, so maybe you may want to do this yourself. Thank you!

aojea commented 1 week ago

@hellt do you still need the bridge mode? is this still running inside kind on Mac?

hellt commented 1 week ago

yes, we still use the bridge mode both on mac and linux also it seems it is quite in demand

image
aojea commented 1 week ago

ok, give me some days to fix this

aojea commented 1 week ago

@hellt the images should be published automatically after this job finish https://github.com/aojea/kindnet/actions/runs/9692669989

I'm going to be AFK for some time, if you check the images are correct and work feel free to close the issue

hellt commented 1 week ago

Thanks @aojea ~~I wonder if that would work as expected, though. Since the cni binaries are still not build for the target (arm64) architecture as far I can see from a quick glance at #36. The go build is executed outside of the dockerfile, so I don't think the container image will contain the arm64 build cni binary...~~

Apologies, I didn't see the folded part in the Dockerfile :sigh:

aojea commented 1 week ago

hmm , to be honest I don't have it clear, it gets the GOARCH argument but I'm always confused building multiarch and never get it at the first try ... do you mind if we iterate based on current run?

aojea commented 1 week ago

ok, is doing the wrong thing

#16 [linux/arm64 builder 4/5] RUN CGO_ENABLED=0 go build -o /go/bin/kindnetd ./cmd/kindnetd
#16 DONE 618.8s
#20 [linux/arm64 builder 5/5] RUN echo "Installing CNI binaries ..."     && export CNI_TARBALL="v1.5.0/cni-plugins-linux-amd64-v1.5.0.tgz"     && export CNI_URL="[https://github.com/containernetworking/plugins/releases/download/${CNI_TARBALL}](https://github.com/containernetworking/plugins/releases/download/$%7BCNI_TARBALL%7D)"     && curl -sSL --retry 5 --output /tmp/cni.tgz "${CNI_URL}"     && mkdir -p /opt/cni/bin     && tar -C /opt/cni/bin -xzf /tmp/cni.tgz     && rm -rf /tmp/cni.tgz     && find /opt/cni/bin -type f -not (          -iname host-local          -o -iname ptp          -o -iname bridge          -o -iname portmap       )       -delete
aojea commented 1 week ago

let's see https://github.com/aojea/kindnet/actions/runs/9695000038/job/26753827829

aojea commented 1 week ago

this time it looks correct

#16 [linux/amd64 builder 5/5] RUN echo "Installing CNI binaries ..."     && export CNI_TARBALL="v1.5.0/cni-plugins-linux-amd64-v1.5.0.tgz"     && export CNI_URL="[https://github.com/containernetworking/plugins/releases/download/${CNI_TARBALL}](https://github.com/containernetworking/plugins/releases/download/$%7BCNI_TARBALL%7D)"     && curl -sSL --retry 5 --output /tmp/cni.tgz "${CNI_URL}"     && mkdir -p /opt/cni/bin     && tar -C /opt/cni/bin -xzf /tmp/cni.tgz     && rm -rf /tmp/cni.tgz     && find /opt/cni/bin -type f -not (          -iname host-local          -o -iname ptp          -o -iname bridge          -o -iname portmap       )       -delete
#16 0.288 Installing CNI binaries ...
#16 DONE 1.3s

#15 [linux/amd64->arm64 builder 5/5] RUN echo "Installing CNI binaries ..."     && export CNI_TARBALL="v1.5.0/cni-plugins-linux-arm64-v1.5.0.tgz"     && export CNI_URL="[https://github.com/containernetworking/plugins/releases/download/${CNI_TARBALL}](https://github.com/containernetworking/plugins/releases/download/$%7BCNI_TARBALL%7D)"     && curl -sSL --retry 5 --output /tmp/cni.tgz "${CNI_URL}"     && mkdir -p /opt/cni/bin     && tar -C /opt/cni/bin -xzf /tmp/cni.tgz     && rm -rf /tmp/cni.tgz     && find /opt/cni/bin -type f -not (          -iname host-local          -o -iname ptp          -o -iname bridge          -o -iname portmap       )       -delete
#15 DONE 1.3s
aojea commented 1 week ago

fantastic, it was a long time since I had to do this, happy to see the ecosystem improved a lot , really neat and simple these days to do multibuild

https://github.com/aojea/kindnet/pkgs/container/kindnetd/235911957?tag=v1.2.0

hellt commented 1 week ago

sweet, thanks a lot @aojea Will do the testing on macOS 14 + kind