coreos / etcd-operator

etcd operator creates/configures/manages etcd clusters atop Kubernetes
https://coreos.com/blog/introducing-the-etcd-operator.html
Apache License 2.0
1.75k stars 741 forks source link

arm compatibility? #2100

Open devinrsmith opened 5 years ago

devinrsmith commented 5 years ago

It seems like the etcd-operator image is not compatible with arm. Any plans for arm support?

$ k get pods
NAME                                                              READY   STATUS             RESTARTS   AGE
my-release-etcd-operator-etcd-backup-operator-7485fbf644-v9xvw    0/1     CrashLoopBackOff   6          7m50s
my-release-etcd-operator-etcd-operator-75d8df8dff-pdgkt           0/1     CrashLoopBackOff   6          7m50s
my-release-etcd-operator-etcd-restore-operator-7674b76f78-qxj5c   0/1     CrashLoopBackOff   6          7m50s

$ k logs my-release-etcd-operator-etcd-operator-75d8df8dff-pdgkt
standard_init_linux.go:211: exec user process caused "exec format error"

$ k describe pods my-release-etcd-operator-etcd-operator-75d8df8dff-pdgkt | grep Image
    Image:         quay.io/coreos/etcd-operator:v0.9.3
    Image ID:      docker-pullable://quay.io/coreos/etcd-operator@sha256:3633b6d103e9efc2798e4214c8ee6d9b78f262eca65f085d76f5b4aee77e1e95

$ uname -a
Linux odroidxu4 4.14.127-odroidxu4 #7 SMP PREEMPT Tue Jun 25 21:14:12 CEST 2019 armv7l GNU/Linux
quantonganh commented 5 years ago

I changed GOARCH in the build.sh script:

diff --git a/hack/lib/build.sh b/hack/lib/build.sh
index 9b2e314..69faafe 100644
--- a/hack/lib/build.sh
+++ b/hack/lib/build.sh
@@ -2,5 +2,5 @@ function go_build {
        echo "building "${1}"..."
        # We’re disabling cgo which gives us a static binary.
        # This is needed for building minimal container based on alpine image.
-       GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $GO_BUILD_FLAGS -o ${bin_dir}/etcd-${1} -installsuffix cgo -ldflags "$go_ldflags" ./cmd/${1}/
+       GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 go build $GO_BUILD_FLAGS -o ${bin_dir}/etcd-${1} -installsuffix cgo -ldflags "$go_ldflags" ./cmd/${1}/

then tried to build but got the following error:

# ./hack/build/operator/build
+ set -o errexit
+ set -o nounset
+ set -o pipefail
+ source hack/lib/build.sh
+ which go
++ git rev-parse --short HEAD
+ GIT_SHA=8347d27
++ pwd
+ bin_dir=/root/go/src/github.com/coreos/etcd-operator/_output/bin
+ mkdir -p /root/go/src/github.com/coreos/etcd-operator/_output/bin
+ gitHash=github.com/coreos/etcd-operator/version.GitSHA=8347d27
+ go_ldflags='-X github.com/coreos/etcd-operator/version.GitSHA=8347d27'
+ GO_BUILD_FLAGS=
+ go_build operator
+ echo 'building operator...'
building operator...
+ GOOS=linux
+ GOARCH=arm
+ GOARM=7
+ CGO_ENABLED=0
+ go build -o /root/go/src/github.com/coreos/etcd-operator/_output/bin/etcd-operator -installsuffix cgo -ldflags '-X github.com/coreos/etcd-operator/version.GitSHA=8347d27' ./cmd/operator/
# github.com/coreos/etcd-operator/pkg/cluster
pkg/cluster/cluster.go:497:17: constant 9223372036854775807 overflows int
quantonganh commented 5 years ago

ah, https://github.com/golang/go/issues/23086