kubernetes-sigs / krew

📦 Find and install kubectl plugins
https://krew.sigs.k8s.io
Apache License 2.0
6.42k stars 369 forks source link

Unable to install Krew on Linux #752

Closed Hector242 closed 2 years ago

Hector242 commented 2 years ago

Hello Team,

I'm trying to install Krew on a Linux server, but I got the following error messages.

[root@vts~]# (

set -x; cd "$(mktemp -d)" && OS="$(uname | tr '[:upper:]' '[:lower:]')" && ARCH="$(uname -m | sed -e 's/x8664/amd64/' -e 's/(arm)(64)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && KREW="krew-${OS}${ARCH}" && curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && tar zxvf "${KREW}.tar.gz" && ./"${KREW}" install krew ) ++ mktemp -d

Checking the tmp file I noticed that the script file is taking another user as it's owner. However, I did try to change the owner to root, but I'm still getting the same error messages.

[root@vts~]# cd /tmp/tmp.q0JygZVSfi/ [root@vts tmp.q0JygZVSfi]# ls -l total 15980 -rwxr-xr-x. 1 redhat 121 12164162 Dec 31 1999 krew-linux_amd64 -rw-r-----. 1 root root 4186018 Jan 3 17:16 krew-linux_amd64.tar.gz -rw-r--r--. 1 redhat 121 11358 Dec 31 1999 LICENSE [root@vts tmp.q0JygZVSfi]#

Thanks in advance, Best.

guettli commented 2 years ago

I just had the same issue. I think it is related to some security-feature that you are not allowed to execute files from /tmp.

I copied the file to /var/tmp, and there it was executable.

ahmetb commented 2 years ago

I think it is related to some security-feature that you are not allowed to execute files from /tmp.

I'd be interested in what that security feature is. If anyone knows, please add a comment. I am able to do docker run --rm alpine + apk add curl git and install Krew in there just fine. So I assume this is not a standard thing.

NimbleArchitect commented 2 years ago

it sounds like SELinux could be blocking it but without knowing more details like the distribution its hard to guess at

I just clocked the username 'redhat' in the output so I'll take a stab and say its related to a SELinux security policy

k8s-triage-robot commented 2 years ago

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:

You can:

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

/lifecycle stale

ahmetb commented 2 years ago

/close not reproducible. please feel free to open a new issue if you have a clean repro.

k8s-ci-robot commented 2 years ago

@ahmetb: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/krew/issues/752#issuecomment-1219819760): >/close >not reproducible. please feel free to open a new issue if you have a clean repro. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.