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

Updating install-kubectl.md with instructions for validating kubectl binaries against checksum files #25259

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

nate-double-u
Copy link
Contributor

@nate-double-u nate-double-u commented Nov 26, 2020

Adding instructions for how to validate kubectl binaries against checksum files (Linux, MacOS, Windows)

Updating links to download from https://dl.k8s.io/

fixes: #25040

Additionally:

  • Adding note annotation around optional download instructions
  • Markdown updates
    • Updating numbered lists to use markdown syntax ("1." for each entry), should make it easier to add and remove list items in future
    • Updating spacing throughout
  • Correcting "PowerShell" spelling
  • Updating install instructions to provide a trusted kubectl:
    • Updating Linux-specific instructions to use install command.
    • Updating macOS-specific instructions to chown root the install to provide a trusted kubectl.

Page updated deploy preview: https://deploy-preview-25259--kubernetes-io-master-staging.netlify.app/docs/tasks/tools/install-kubectl/

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language labels Nov 26, 2020
@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 26, 2020
@nate-double-u
Copy link
Contributor Author

nate-double-u commented Nov 26, 2020

Tested on:

  • Ubuntu 20.04.1 LTS
  • macOS Catalina Version 10.15.7 (using terminal app, no non-standard applications need be installed)
  • Windows 10 Pro (using Command Prompt and PowerShell)

@netlify
Copy link

netlify bot commented Nov 26, 2020

✔️ Deploy preview for kubernetes-io-master-staging ready!

🔨 Explore the source changes: ac8b4c5

🔍 Inspect the deploy logs: https://app.netlify.com/sites/kubernetes-io-master-staging/deploys/5fdd057d9be22e00086dede7

😎 Browse the preview: https://deploy-preview-25259--kubernetes-io-master-staging.netlify.app

@nate-double-u
Copy link
Contributor Author

Page updated deploy preview: https://deploy-preview-25259--kubernetes-io-master-staging.netlify.app/docs/tasks/tools/install-kubectl/

I'm not particularly happy with the Windows and MacOS sections yet, as I haven't found a way to programmatically validate the binary against the checksum file like I do in the Linux section -- I have to do a bit more research into the MacOS and Windows tools. If anyone knows a better way off the top of their head, I'd appreciate a pointer.

@nate-double-u
Copy link
Contributor Author

nate-double-u commented Nov 26, 2020

Comment/question premature, edited out to clean up the PR.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 27, 2020
@nate-double-u
Copy link
Contributor Author

Links updated to download from https://dl.k8s.io/

@sftim
Copy link
Contributor

sftim commented Nov 27, 2020

using {{< param "fullversion" >}} to build the urls for the curl commands.

The difference in patch version comes down to the website getting a (manual) update per minor release but nothing happening on patch releases.
I suspect we can do something about that. The story for downloading the latest version Kubernetes proper is also not great.

I think we ought to find the simplest way of getting a Kubernetes release metadata file published, make that publication happen, and update based on that. There are other options though.

@nate-double-u
Copy link
Contributor Author

The difference in patch version comes down to the website getting a (manual) update per minor release but nothing happening on patch releases.

I figured something like this was happening (hence the comment edit -- still not sure of the etiquette of those kinds of edits...).

I think in this case I'm going to try to be consistent with the the stable release where offered, i.e. I'll link to the stable release sha as well (and may do a little to make it more obvious what is being downloaded 'latest' vs 'latest stable'). If someone is going through the instructions to download, verify, and install, it would be irritating for the supplied sha to be for a different version than was just linked to.

@nate-double-u
Copy link
Contributor Author

nate-double-u commented Nov 28, 2020

I've found a way to automate the validation on MacOS the way we are doing in Linux, and I've found a workaround with PowerShell that we can use for Windows (though I'm still not thrilled with that method).

@nate-double-u nate-double-u marked this pull request as ready for review November 28, 2020 00:19
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 28, 2020
@nate-double-u nate-double-u force-pushed the 25040-sha256-checks branch 2 times, most recently from 2abb2f9 to 2acbac3 Compare November 28, 2020 00:38
@nate-double-u
Copy link
Contributor Author

nate-double-u commented Nov 28, 2020

I like how we use the tabs in the Install on Windows using Chocolatey or Scoop section

Could we consider using a similar Linux, macOS, Windows tab structure and create a Install kubectl section containing it? It may help to shorten the page, and give people an opportunity to get directly to what they are looking for without a lot of scrolling.

We may also be able to de-duplicate some of the instructions doing it that way, but I think this work would be well outside the scope of this PR.

[edit] We do a simiar thing in the Optional kubectl configurations section as well.

@nate-double-u
Copy link
Contributor Author

The last push cleans up the Windows Validation section's formatting a bit.

@nate-double-u
Copy link
Contributor Author

The last push adds some syntax highlighting to the command snippets.

@nate-double-u nate-double-u changed the title Updating /docs/tasks/tools/install-kubectl Updating install-kubectl.md with instructions for validating kubectl binaries against checksum files Dec 11, 2020
@nate-double-u nate-double-u force-pushed the 25040-sha256-checks branch 2 times, most recently from c1bd0ee to 56faf09 Compare December 17, 2020 21:26
@nate-double-u
Copy link
Contributor Author

nate-double-u commented Dec 17, 2020

The latest push removes the incorrectly updated spacing changes I introduced.

@kbhawkey
Copy link
Contributor

Thanks @nate-double-u .
I think the changes are looking good. Noted a few nits, otherwise 👍

Adding instructions for how to validate kubectl binaries against checksum files (Linux, MacOS, Windows)

Updating links to download from https://dl.k8s.io/

Updating Linux-specific install instructions to use install command, and
macOS-specific instructions to chown root the install to provide a trusted
kubectl.

Adding note annotation around optional download instructions

Markdown updates
* Updating numbered lists to use markdown syntax ("1." for each entry), should make it easier to add and remove list items in future
* Adding some syntax highlighting to the command snippets

Correcting "PowerShell" spelling

fixes: kubernetes#25040

Signed-off-by: Nate W <4453979+nate-double-u@users.noreply.github.com>
@nate-double-u
Copy link
Contributor Author

nate-double-u commented Dec 18, 2020

Latest push:

  • Updates copy as per PR feedback
  • Updates install instructions to provide a trusted kubectl:
    • Linux-specific instructions to use install command.
    • macOS-specific instructions to chown root the install to provide a trusted kubectl.

@kbhawkey
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 18, 2021
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e82310340ea3cc002bf151395e60861d06aa9ff8

@zacharysarah
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zacharysarah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 19, 2021
@k8s-ci-robot k8s-ci-robot merged commit a5630c5 into kubernetes:master Jan 19, 2021
@nate-double-u
Copy link
Contributor Author

Thanks everyone, I appreciate all the feedback on this one!

@nate-double-u nate-double-u deleted the 25040-sha256-checks branch January 19, 2021 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. sig/security Categorizes an issue or PR as relevant to SIG Security. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document how to validate kubectl binary against checksum / signature
7 participants