website icon indicating copy to clipboard operation
website copied to clipboard

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

Open Asvarduil opened this issue 3 years ago • 21 comments

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.

Asvarduil avatar Jun 10 '22 20:06 Asvarduil

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

jihoon-seo avatar Jun 10 '22 23:06 jihoon-seo

@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.

nitishfy avatar Jun 11 '22 04:06 nitishfy

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 avatar Jun 12 '22 16:06 sftim

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

sftim avatar Jun 12 '22 16:06 sftim

/sig release

sftim avatar Jun 12 '22 17:06 sftim

@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!

Asvarduil avatar Jun 17 '22 14:06 Asvarduil

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

sftim avatar Jun 17 '22 15:06 sftim

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.

BenTheElder avatar Jun 20 '22 19:06 BenTheElder

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/110667 – not this issue – to coordinate.

sftim avatar Jun 21 '22 09:06 sftim

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

sftim avatar Aug 11 '22 15:08 sftim

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

sftim avatar Aug 11 '22 15:08 sftim

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 Nov 09 '22 16:11 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 Dec 09 '22 17:12 k8s-triage-robot

/remove-lifecycle rotten

sftim avatar Dec 10 '22 15:12 sftim

/priority important-longterm

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

sftim avatar Dec 10 '22 15:12 sftim

@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).

mrgiles avatar Jul 28 '23 23:07 mrgiles

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

sftim avatar Jul 30 '23 21:07 sftim

/remove-priority important-longterm

sftim avatar Jul 30 '23 21:07 sftim

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

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Close this issue with /close

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

/remove-triage accepted

k8s-triage-robot avatar Jul 29 '24 21:07 k8s-triage-robot

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 / ...

BenTheElder avatar Jul 29 '24 21:07 BenTheElder

@Asvarduil is this still a concern?

sftim avatar Jul 30 '24 08:07 sftim

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

This bot triages un-triaged issues 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 as fresh with /remove-lifecycle stale
  • Close this issue 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 Oct 28 '24 08:10 k8s-triage-robot

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

This bot triages un-triaged issues 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 as fresh with /remove-lifecycle rotten
  • Close this issue 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 Nov 27 '24 08:11 k8s-triage-robot

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

This bot triages issues 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:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close not-planned

k8s-triage-robot avatar Dec 27 '24 09:12 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

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

This bot triages issues 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:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close not-planned

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-sigs/prow repository.

k8s-ci-robot avatar Dec 27 '24 09:12 k8s-ci-robot