ingress-nginx icon indicating copy to clipboard operation
ingress-nginx copied to clipboard

kubectl plugin cannot be installed on Apple Silicon (darwin/arm64)

Open iben12 opened this issue 2 years ago • 8 comments

NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.): n/a

Kubernetes version (use kubectl version): Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.4", GitCommit:"b695d79d4f967c403a96986f1750a35eb75e75f1", GitTreeState:"clean", BuildDate:"2021-11-17T15:48:33Z", GoVersion:"go1.16.10", Compiler:"gc", Platform:"darwin/arm64"}

Environment:

  • Cloud provider or hardware configuration: n/a
  • OS (e.g. from /etc/os-release): MacOS 12.1 (21C52)
  • Kernel (e.g. uname -a): Darwin *** 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64

What happened:

I tried to install the kubectl plugin for ingress-nginx as described in the docs:

kubectl krew install ingress-nginx
Updated the local copy of plugin index.
Installing plugin: ingress-nginx
W0126 13:21:27.097874   59776 install.go:164] failed to install plugin "ingress-nginx": plugin "ingress-nginx" does not offer installation for this platform
F0126 13:21:27.098127   59776 root.go:79] failed to install some plugins: [ingress-nginx]: plugin "ingress-nginx" does not offer installation for this platform

My krew seems to be intalled correctly:

kubectl krew version 
OPTION            VALUE
GitTag            v0.4.2
GitCommit         6fcdb79
IndexURI          https://github.com/kubernetes-sigs/krew-index.git
BasePath          /Users/me/.krew
IndexPath         /Users/me/.krew/index/default
InstallPath       /Users/me/.krew/store
BinPath           /Users/me/.krew/bin
DetectedPlatform  darwin/arm64

What you expected to happen:

Plugin is installed

How to reproduce it: See above

Anything else we need to know: As I see in the krew plugin manifest here this should work, the plugin has darwin/arm64 build.

I can install other plugins.

iben12 avatar Jan 26 '22 15:01 iben12

@iben12: This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jan 26 '22 15:01 k8s-ci-robot

Thanks! kubectl plugin has not been updated for a long time. I will deal with it ASAP.

We can using #7627 for tracking.

tao12345666333 avatar Jan 26 '22 16:01 tao12345666333

Workaround for lonely souls:

git clone [email protected]:kubernetes/ingress-nginx.git && cd ingress-nginx

make build-plugin && cd cmd/plugin/release/
nano ingress-nginx.yaml # Need to remove on `v` for version number line `9`, issue #8217 
tar xf kubectl-ingress_nginx-darwin-arm64.tar.gz
kubectl krew install --manifest=ingress-nginx.yaml --archive=kubectl-ingress_nginx-darwin-arm64.tar.gz

winnieoursbrun avatar Feb 03 '22 11:02 winnieoursbrun

For those of us on macbooks and podman, I've modified the Makefile target for run-in-docker to skip the options that work on my machine. Make sure you let podman know that your home directory is available for mounts.

# assumes default machine name...
podman machine init --cpus=4 --memory=4096 -v $HOME:$HOME
# source: github.com/kubernetes/ingress-nginx@529844886
# source: build/run-in-docker.sh
#
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
make_build_plugin() {
    # temporal directory for the /etc/ingress-controller directory
    INGRESS_VOLUME="$(PWD)/vol/etc/ingress-controller"

    # make sure directory for SSL cert storage exists under ingress volume
    mkdir "${INGRESS_VOLUME}/ssl"

    E2E_IMAGE=${E2E_IMAGE:-k8s.gcr.io/ingress-nginx/e2e-test-runner:v20220110-gfd820db46@sha256:273f7d9b1b2297cd96b4d51600e45d932186a1cc79d00d179dfb43654112fe8f}

    DOCKER_OPTS=${DOCKER_OPTS:-}

    KUBE_ROOT="$(pwd)"
    PKG=k8s.io/ingress-nginx
    ARCH="$(arch)"
    COMMIT_SHA="$(git rev-parse --short HEAD)"
    REPO_INFO="$(git config --get remote.origin.url)"
    TAG="v1.1.2"
    FLAGS="GOBUILD_FLAGS='--tags netgo' PKG=$PKG ARCH=$ARCH COMMIT_SHA=$COMMIT_SHA REPO_INFO=$REPO_INFO TAG=$TAG"
    
    # create output directory as current user to avoid problem with docker.
    mkdir -p "${KUBE_ROOT}/bin" "${KUBE_ROOT}/bin/${ARCH}"

    docker run -i                                              \
           --tty                                               \
           --rm                                                \
           -e GOCACHE="/go/src/${PKG}/.cache"                  \
           -e GOMODCACHE="/go/src/${PKG}/.modcache"            \
           -e DOCKER_IN_DOCKER_ENABLED="true"                  \
           -v "${HOME}/.kube:${HOME}/.kube"                    \
           -v "${KUBE_ROOT}:/go/src/${PKG}"                    \
           -v "${KUBE_ROOT}/bin/${ARCH}:/go/bin/linux_${ARCH}" \
           -v "${INGRESS_VOLUME}:/etc/ingress-controller/"     \
           -w "/go/src/${PKG}"                                 \
           "${E2E_IMAGE}" /bin/bash -c "$FLAGS /go/src/${PKG}/build/build-plugin.sh"

}

mkdir -p ~/tmp
_tmp="$(mktemp -d ~/tmp/sre.XXXXXX)"
git clone https://github.com/kubernetes/ingress-nginx.git "$_tmp"
cd "$_tmp" || exit 1
make_build_plugin
cd cmd/pluin/release/ || exit 1
kubectl krew install --manifest=ingress-nginx.yaml --archive=kubectl-ingress_nginx-darwin-arm64.tar.gz

I noticed that the "vv" bug was fixed, so that's no longer an issue. Thankfully, I didn't have to add sed anywhere to my script otherwise it might have been too much to bother with.

symbl-ay avatar Mar 26 '22 00:03 symbl-ay

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 24 '22 00:06 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jul 24 '22 01:07 k8s-triage-robot

/remove-lifecycle rotten

tpoindessous avatar Jul 25 '22 10:07 tpoindessous

Workaround for lonely souls:

git clone [email protected]:kubernetes/ingress-nginx.git && cd ingress-nginx

make build-plugin && cd cmd/plugin/release/
nano ingress-nginx.yaml # Need to remove on `v` for version number line `9`, issue #8217 
tar xf kubectl-ingress_nginx-darwin-arm64.tar.gz
kubectl krew install --manifest=ingress-nginx.yaml --archive=kubectl-ingress_nginx-darwin-arm64.tar.gz

thanks. before running make, i needed to set GOBUILD_FLAGS in build/build-plugin.sh before go build was being run

twixthehero avatar Aug 10 '22 07:08 twixthehero

The solution to @twixthehero is no longer working. No build target for plugin any more.

Starefossen avatar Aug 26 '22 13:08 Starefossen

@Starefossen Syncing back to c85765a015ea6709d161eccd42ef6134981c04b4 (just before 2022 Aug 11th) helps with that, though I'm not sure what critical updates we are missing by doing that.

gsimko avatar Sep 18 '22 03:09 gsimko

Might be blocked by #8812

evenh avatar Dec 05 '22 14:12 evenh

it's still an issue, right? getting

failed to install some plugins: [ingress-nginx]: plugin "ingress-nginx" does not offer installation for this platform

timown avatar Apr 24 '23 09:04 timown

Also still an issue for me on darwin/arm64

ContainerCat avatar May 03 '23 08:05 ContainerCat

can we get a darwin/arm64 version? :) Would be so beautiful

LittleHoopoe avatar May 19 '23 09:05 LittleHoopoe

Still a problem in August 2023 Why is this closed? Please reopen.

joeloplot avatar Aug 14 '23 01:08 joeloplot