cockroachdb / cockroach-operator

k8s operator for CRDB
Apache License 2.0
283 stars 95 forks source link

Multiarch Images that include arm64 #942

Open DWSR opened 1 year ago

DWSR commented 1 year ago

CRDB supports arm64 (among other archs) so the operator should as well. This is relevant to anyone running e.g. Graviton (AWS), Tau (GCP) or Ampere (OCI) instances.

djh00t commented 1 year ago

I have also just run into this issue. arm64 is becoming very common.

mprimeaux commented 1 year ago

Support for ARM64 is critical for our workloads as the CPU architecture represents a 40% cost per transaction savings. Is there any contribution I can assist with to progress this effort?

jrcichra commented 9 months ago

I don't know bazel enough to make a PR but if you want to get an arm64 build out of the repo you can do:

GOOS=linux GOARCH=arm64 go build -o cockroach-operator -v cmd/cockroach-operator/*.go

At any particular commit.

That gave me:

cockroach-operator: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=NiSUAYgI0rbcdPA7PYjc/UFkJjm-xuVoYR4fPsmMj/uMfJt6MBxBsHXmbnuZ9r/oydO3GqKyb2LA7yOqW9U, with debug_info, not stripped

Then you can copy the binary into a docker container.

jrcichra commented 9 months ago

Obviously not official nor supported but I set up a mutli-arch build pipeline for cockroach-operator using those principles: https://github.com/jrcichra/cockroach-operator-multiarch

https://github.com/jrcichra/cockroach-operator-multiarch/pkgs/container/cockroach-operator

It's working on my oracle cloud k8s cluster.