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

Kustomize v3 does not provide bin for mac (arm64) #2566

Closed
camilamacedo86 opened this issue Mar 27, 2022 · 6 comments · Fixed by #2583
Closed

Kustomize v3 does not provide bin for mac (arm64) #2566

camilamacedo86 opened this issue Mar 27, 2022 · 6 comments · Fixed by #2583
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@camilamacedo86
Copy link
Member

What broke? What's expected?

In order to support go 1.18 (#2486) we change the Makefile:

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
	$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])

To use the script:

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE):
	curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN)

However, the v3 versions do not provide darwin arm64 binaries:

See https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv3.10.0. (latest)
But it is provided for v4: https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv4.5.3

Then, we need to:
a) verify if we have not another option to install kustomize v3
OR
b) revisit the option to update to kustomize v4 (it has breaking changes, see: #2498 (comment). Also, see #2498 (comment))

Reproducing this issue

No response

KubeBuilder (CLI) Version

master

PROJECT version

3

Plugin versions

Default version 3

Other versions

No response

Extra Labels

/kind regression

@camilamacedo86 camilamacedo86 added the kind/bug Categorizes issue or PR as related to a bug. label Mar 27, 2022
@k8s-ci-robot k8s-ci-robot added the kind/regression Categorizes issue or PR as related to a regression from a prior release. label Mar 27, 2022
@camilamacedo86 camilamacedo86 added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Mar 27, 2022
@camilamacedo86
Copy link
Member Author

@ryantking we need to check this one.
It blocks the release.

@camilamacedo86 camilamacedo86 added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/regression Categorizes issue or PR as related to a regression from a prior release. labels Mar 30, 2022
@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Mar 30, 2022

arm64 is still not supported (we might able to begin to provide its bins for the next KB release, see #2505). So we could say that is a feature request.

To add the convey of the discussions made so far:

if we bump kustomize v4 on the plugin go/v3

  • then we provide support for arm64
  • however, we also might face the risk of introducing a breaking change (we cannot introduce breaking changes for stable plugins)
  • theoretically, if we do not change the scaffolds to use the new feature provided in kustomize v4 and do not remove what is deprecated then it could still be compatible (we cannot for example vars and replacements then which means that the scaffold will not work with v3)
  • but that probably also means adding a test where we ensure that the default scaffold still working with v3

PS: Actually to introduce the changes scaffold changes of kustomize we will need a new kustomize plugin and not go/v4: See: https://github.com/kubernetes-sigs/kubebuilder/pull/2498/files. However, we also bump the version on the plugin which is used to generate scaffold the Makefile in the target to download the bin. More info: #2503 (comment)

Alternative Options:
a) Check if the kustomize project would be able to begin to provide the bins for os arm64
OR/AND
b) Just use kustomize v4 in a new plugin go/v4-alpha so that we can ensure that we will not break anything for the stable plugins and allow this option for the users.
c) Another idea was to check if we could not provide kustomize v4 as optional via flag/makefile target, e.g:

kustomize-v4  EXPERIMENTAL: Scaffold Makefiles with kustomize v4 instead of v3. Required for Apple silicon.

Then we do a check like the following for this arch:

if runtime.GOOS == "Darwin" && runtime.GOARDH == "aarm6" {
    return errors.New("Apple Silicon users must run with `--kustomize-v4` enabled. Read more about this here: https://a-fantastic-document/")
}

So that we would provide the option for the users but we would not be introducing it by default.

@camilamacedo86 camilamacedo86 changed the title (master) - unable to install kustomize on mac os x (arm64) Kustomize v3 does not provide bin for mac (arm64) Mar 30, 2022
@camilamacedo86 camilamacedo86 self-assigned this Mar 31, 2022
@camilamacedo86 camilamacedo86 added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label May 5, 2022
mbana pushed a commit to kubeshop/kusk-gateway that referenced this issue May 18, 2022
* Replace `go get` with `go install` in `Makefile`.
* Tidy up `Makefile`.
* Introduce `tools` in `Makefile` that downloads all the tools/dependencies required.
* `DOCKER_BUILDKIT`: No point in defining this everyone - exporting and defining should be enough.

For further information, see:

* kubernetes-sigs/kubebuilder#2566
* kubernetes-sigs/kubebuilder#2486
mbana added a commit to kubeshop/kusk-gateway that referenced this issue May 18, 2022
* Replace `go get` with `go install` in `Makefile`.
* Tidy up `Makefile`.
* Introduce `tools` in `Makefile` that downloads all the tools/dependencies required.
* `DOCKER_BUILDKIT`: No point in defining this everyone - exporting and defining should be enough.

For further information, see:

* kubernetes-sigs/kubebuilder#2566
* kubernetes-sigs/kubebuilder#2486
@camilamacedo86
Copy link
Member Author

From the master branch is possible to know we use init --plugins=base.go/v3,kustomize/v4-alpha so that we would scaffold the golang based plugin used by default with the new kustomize.

mbana added a commit to kubeshop/kusk-gateway that referenced this issue May 24, 2022
* Replace `go get` with `go install` in `Makefile`.
* Tidy up `Makefile`.
* Introduce `tools` in `Makefile` that downloads all the tools/dependencies required.
* `DOCKER_BUILDKIT`: No point in defining this everyone - exporting and defining should be enough.

For further information, see:

* kubernetes-sigs/kubebuilder#2566
* kubernetes-sigs/kubebuilder#2486
mbana pushed a commit to kubeshop/kusk-gateway that referenced this issue May 25, 2022
Fix/Cleanup `Makefile` - Closes #418:

* Replace `go get` with `go install` in `Makefile`.
* Tidy up `Makefile`.
* Introduce `tools` in `Makefile` that downloads all the tools/dependencies required.
* `DOCKER_BUILDKIT`: No point in defining this everyone - exporting and defining should be enough.

For further information, see:

* kubernetes-sigs/kubebuilder#2566
* kubernetes-sigs/kubebuilder#2486
@SkYNewZ
Copy link

SkYNewZ commented Jun 20, 2022

Hi. I cannot use the kustomize alpha plugin.

❯ kubebuilder init --plugins=base.go/v3,kustomize/v4-alpha
Error: no plugin could be resolved with key "kustomize/v4-alpha" (plugin version is unstable, there may be an upgrade available: https://kubebuilder.io/migration/plugin/plugins.html)
❯ kubebuilder version
Version: main.version{KubeBuilderVersion:"HEAD-8ec681a", KubernetesVendor:"unknown", GitCommit:"8ec681ae5a7bf3751e2539a7b7b4677c255f6a0f", BuildDate:"2022-06-20T11:56:04Z", GoOs:"darwin", GoArch:"arm64"}

@camilamacedo86
Copy link
Member Author

Hi @SkYNewZ,

The plugin is only available on master, to call it you --plugins="kustomize/v2-alpha,base.go.kubebuilder.io/v3" (not v4-alpha)

Also, see; #2758
After we merge this one the stable plugin (default scaffold done with kubebuilder init) will have the bump. However, the syntax done for it will still use for example vars and not replacements which works from 4x only.

@SkYNewZ
Copy link

SkYNewZ commented Jun 21, 2022

Thanks you @camilamacedo86 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
3 participants