nmstate / kubernetes-nmstate

Declarative node network configuration driven through Kubernetes API.
GNU General Public License v2.0
176 stars 87 forks source link

Handler arm build does not work on v0.77.0 #1178

Closed Gentoli closed 1 year ago

Gentoli commented 1 year ago

What happened: In the arm image, manager in handler calls nmstatectl, but nmstatectl the bundled binary is not executable on arm.

What you expected to happen: handler pods runs.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

Logs:

{"level":"info","ts":"2023-04-19T08:56:52.376Z","logger":"setup","msg":"Try to take exclusive lock on file: /var/k8s_nmstate/handler_lock"}
{"level":"info","ts":"2023-04-19T08:56:52.376Z","logger":"setup","msg":"Successfully took nmstate exclusive lock"}
{"level":"error","ts":"2023-04-19T08:56:52.410Z","logger":"setup","msg":"failed checking nmstatectl health","error":"failed to execute nmstatectl show: 'fork/exec /usr/bin/nmstatectl: exec format error' '' ''","stacktrace":"main.checkNmstateIsWorking\n\t/workdir/cmd/handler/main.go:245\nmain.mainHandler\n\t/workdir/cmd/handler/main.go:150\nmain.main\n\t/workdir/cmd/handler/main.go:82\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:250"}
qinqon commented 1 year ago

Clearly we are building the x86_64 versions when we do "ARCH=arm64"

Running transaction
  Preparing        :                                                        1/1 
  Installing       : nmstate-2.2.10-3.el9.x86_64                            1/1 
  Running scriptlet: nmstate-2.2.10-3.el9.x86_64                            1/1 
  Verifying        : nmstate-2.2.10-3.el9.x86_64                            1/1
Gentoli commented 1 year ago

@qinqon I think the base image is using the wrong architecture, that's why the package manager installs the amd64 version

qinqon commented 1 year ago

@Gentoli found the issue https://github.com/nmstate/kubernetes-nmstate/pull/1188

qinqon commented 1 year ago

@Gentoli can you verify v0.78.0 works fine at arm64 now ?

Gentoli commented 1 year ago

@qinqon Thanks for checking. Looks like v0.78.0 works 🎉

~ % kubectl exec nmstate-handler-hrgqz -n nmstate -it -- sh
sh-5.1# nmstatectl 
error: 'nmstatectl' requires a subcommand but one was not provided

USAGE:
    nmstatectl [OPTIONS] <SUBCOMMAND>

For more information try --help
sh-5.1# uname -a
Linux oke-c46r437jxda-n6xzpyovv4a-sk5oftixwhq-0 5.15.0-6.80.3.1.el8uek.aarch64 #2 SMP Tue Jan 10 12:26:56 PST 2023 aarch64 aarch64 aarch64 GNU/Linux
sh-5.1# 
exit
~ % kubectl get pod nmstate-handler-hrgqz -n nmstate -o yaml | grep image
    image: quay.io/nmstate/kubernetes-nmstate-handler:v0.78.0
    imagePullPolicy: Always
    image: quay.io/nmstate/kubernetes-nmstate-handler:v0.78.0
    imageID: quay.io/nmstate/kubernetes-nmstate-handler@sha256:92437bdead30e63a90a843d3430eceb39ab15fc9a338368ce1ba9ba42b9139cc