kubernetes / website

Kubernetes website and documentation repo:
https://kubernetes.io
Creative Commons Attribution 4.0 International
4.44k stars 14.31k forks source link

Install and Set Up kubectl on Linux - No set of instructions actually works for WSL + Ubuntu #34224

Open Asvarduil opened 2 years ago

Asvarduil commented 2 years ago

None of the sets of instructions is working on Windows Linux Subsystem / Ubuntu.

  1. CURL The CURL instructions receive an error Permissions Denied, likely due to my default path being mnt/c/windows/windows32. Something that could make these instructions more helpful is telling us a better place to install kubectl to.

  2. Native Package Management Step 3 of this set of instructions does not create a valid GPG entry, therefore the final step does not work correctly.

  3. 'Other' Package Management After running these steps, I get the error message E: Cannot locate package kubectl as if they outright did not work. No further information is given.

I highly recommend updating these steps with more descriptive information on how to overcome these error states. I attempted to search StackOverflow and other developer resources, but could find no information on what to do if kubernetes fails to install.

jihoon-seo commented 2 years ago

Related page: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

nitishfy commented 2 years ago

@Asvarduil I think you need to be a root user first. Use sudo -i command first and then execute the other commands. I recommend you first have a basic understanding of file systems in Linux like the role of the root user etc.

sftim commented 2 years ago

The issue with the PGP keys is a Kubernetes issue rather than a documentation bug. At the moment, package generation and signing happens outside the Kubernetes project as a best-effort activity by some Google staff. I'm not sure if there's an issue specifically to track this for kubectl. https://github.com/kubernetes/release/issues/913 is perhaps the closest that exists. @Asvarduil that information doesn't help you so much but perhaps it provides context at least? You're welcome to upvote https://github.com/kubernetes/release/issues/913 to highlight the shortcoming.

We could update these instructions to mention that the Windows instructions are for Windows itself, and that the Linux instructions are for typical Linux systems.

This issue could become a feature request to enhance the Install and Set Up kubectl on Windows page to also cover installing kubectl within WSL.

Separately, but related, we could add a prerequisitive comment for less experienced readers, at the start of https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-kubectl-binary-with-curl-on-linux The comment should explain that before you try to download kubectl, you must be in a directory to which you have write access.

sftim commented 2 years ago

BTW, you don't need superuser access to install kubectl

sftim commented 2 years ago

/sig release

Asvarduil commented 2 years ago

@sftim - Thank you for the info, recommendations and responses!

I am a newcomer to kubernetes and cloud technology writ large. As a newcomer, additions of clarifications are simply too valuable to folks in my position. Adding more clarification doesn't just help me, but other people in my position.

I also upvoted kubernetes/release#913 as requested - I didn't know that the PGP step of the Native Package Management instructions had an actual problem, but hopefully this helps advance the fix that issue.

I appreciate all the help, thank you all very much!

sftim commented 2 years ago

Anyone reading this: it's not a simple fix. Please bear that in mind before opening PRs with a fix.

That said, improvements really are welcome; you just might need to think them through a bit. Try hard not to advise people to skip PGP checks; these security checks exist for a good reason. It's OK to tell people that the repository signatures are invalid due to a bug.

/language en /triage accepted

BenTheElder commented 2 years ago

It's OK to tell people that the repository signatures are invalid due to a bug.

See https://github.com/kubernetes/kubernetes/issues/110667#issuecomment-1160787376 for more discussion on why the signatures should be valid but yum can't handle them / yum's repo signature check is broken. Since yum is deprecated perhaps the path forward is to point people towards a non-deprecated tool (and if it is also broken, to fix it / file an issue upstream).

Independently, we should be moving to a community controlled package host as sftim already mentioned, help with https://github.com/kubernetes/release/issues/913 would be very welcome.

sftim commented 2 years ago

If anyone's seeing this from a docs side and wants to away team into SIG Release to help clear this, I suggest using https://github.com/kubernetes/kubernetes/issues/110667not this issue – to coordinate.

sftim commented 2 years ago

Duplicated by https://github.com/kubernetes/website/issues/35868 (I think)

sftim commented 2 years ago

~Rather than set gpgcheck=0, let's just not specify a value for gpgcheck.~

k8s-triage-robot commented 1 year 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

k8s-triage-robot commented 1 year ago

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:

You can:

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

/lifecycle rotten

sftim commented 1 year ago

/remove-lifecycle rotten

sftim commented 1 year ago

/priority important-longterm

At a minimum, we could tell readers that there are snags.

mrgiles commented 1 year ago

@sftim, I think that this issue should be retitled from: Install and Set Up kubectl on Linux - No set of instructions actually works -> to: Install and Set Up kubectl on WLS Linux - No set of instructions actually works. The current title suggests that the installation instructions don't work on ANY Linux distribution, which I think it's inaccurate, this looks like an issue with Windows Subsystem for Linux (Note: I don't have a Windows system to test this).

sftim commented 1 year ago

I've gone for /retitle Install and Set Up kubectl on Linux - No set of instructions actually works for WSL + Ubuntu

sftim commented 1 year ago

/remove-priority important-longterm

k8s-triage-robot commented 1 month ago

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

BenTheElder commented 1 month ago

NOTE: Package hosting has moved to the community package host since this was filed.

This should probably be re-evaluated in light of the current package hosting / signing / ...

sftim commented 1 month ago

@Asvarduil is this still a concern?