Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OperatorSDK 1.21 on M1 Macs fails to install kustomize #5810

Closed
joelddiaz opened this issue May 26, 2022 · 5 comments
Closed

OperatorSDK 1.21 on M1 Macs fails to install kustomize #5810

joelddiaz opened this issue May 26, 2022 · 5 comments
Labels
language/go Issue is related to a Go operator project

Comments

@joelddiaz
Copy link

Bug Report

What did you do?

Followed the migration steps as documented in https://master.sdk.operatorframework.io/docs/upgrading-sdk-version/v1.21.0/

Now make kustomize fails with:

jdiaz@joels-air mondoo-operator (operator-sdk-1.21 *) % make kustomize
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- 3.8.7 /Users/jdiaz/projects/mondoo-operator/src/go.mondoo.com/mondoohq/mondoo-operator/bin
Version v3.8.7 does not exist.
make: *** [/Users/jdiaz/projects/mondoo-operator/src/go.mondoo.com/mondoohq/mondoo-operator/bin/kustomize] Error 1

What did you expect to see?

The ability to continue to build the operator in my M1 Mac environment.

What did you see instead? Under which circumstances?

The version of kustomize (v3.8.7) that is passed to the kustomize install script was never built for arm64 Macs. So there is no tarball to download, and no kustomize gets installed.

Environment

Mac OS 12.3.1 on an arm64 Mac:
Darwin joels-air.lan 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:47:26 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T8101 arm64

Operator type:

/language go

Kubernetes cluster type:
N/A

$ operator-sdk version
operator-sdk version: "v1.21.0", commit: "89d21a133750aee994476736fa9523656c793588", kubernetes version: "v1.23", go version: "go1.17.10", GOOS: "darwin", GOARCH: "arm64"

$ go version (if language is Go)
go version go1.17.7 darwin/arm64

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.4", GitCommit:"e6c093d87ea4cbb530a7b2ae91e54c0842d8308a", GitTreeState:"clean", BuildDate:"2022-02-16T12:30:48Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"darwin/arm64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:19:12Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/arm64"}

Possible Solution

Move to a version of kustomize which has pre-built kustomize for arm64 Darwin (v4.2.0 is the first darwin/arm64 AFAICT)???

Additional context

@openshift-ci openshift-ci bot added the language/go Issue is related to a Go operator project label May 26, 2022
@camilamacedo86
Copy link
Contributor

Same #5785 (comment).

@everettraven
Copy link
Contributor

As @camilamacedo86 mentioned, this is a known issue and we are waiting for Kubebuilder to support the darwin/arm64 platform before Operator SDK can start supporting it. There is currently a few efforts in place to get Kubebuilder to begin supporting this platform.

Due to this I am closing this issue.

@Starefossen
Copy link

If anyone else is stuck on this here is how I solved it to get make deploy working without having to modify the makefile:

brew install kustomize
ln -s $(which kustomize) ./bin/kustomize

@RiRa12621
Copy link

RiRa12621 commented Nov 29, 2023

@everettraven is there an issue on the kubebuilder side that one could track that's related because it's over a year later and the issue is still the same.

The only relevant issue I found is kubernetes-sigs/kubebuilder#2785, which to my understanding, would mean that the kubebuilder side is ready?

@everettraven
Copy link
Contributor

@RiRa12621 I don't have an issue off the top of my head, but I do believe the earliest version of the Operator-SDK this was fixed in was v1.23.0, which contains #5965. I do believe this is only fixed when using the ansible, helm, and go/v4-alpha plugins though.

We are currently working on performing some upgrades alongside our next kubernetes bump to make this the default as the go/v4 plugin provided by kubebuilder is no longer in an alpha state. I would recommend upgrading to the latest release of the Operator-SDK if possible. If not possible, it should be possible to manually upgrade the kustomize version in your Makefile to one that has binaries released for Apple Silicon (go/v4 plugin uses v4.5.7) but you may have to do some manual migration work on your kustomization.yaml files.

I hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/go Issue is related to a Go operator project
Projects
None yet
Development

No branches or pull requests

5 participants