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

Fix advice about checking certificate expiry #45127

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

wushka00
Copy link
Contributor

In this section - I found the provided commands didn't generate the desired results.

The proposed commands seem to work for me.

Validated with:

kubectl version
Client Version: v1.28.6
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.28.6

openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

base64 (GNU coreutils) 8.32

In this section - I found the provided commands didn't generate the desired results.

The proposed commands seem to work for me.

Validated with:

kubectl version
Client Version: v1.28.6
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.6

openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

base64 (GNU coreutils) 8.32
Copy link

linux-foundation-easycla bot commented Feb 13, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 13, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @wushka00!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 13, 2024
@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Feb 13, 2024
Copy link

netlify bot commented Feb 13, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 6ea1067
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/6624980d8ab95a00086b5747
😎 Deploy Preview https://deploy-preview-45127--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 13, 2024
Copy link
Contributor

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor detail. Otherwise I think this looks good. Piping the output is simpler than having a nested command, and makes it easier to inspect things visually if you want to drop any of the trailing commands.

Thanks and agreed regarding format change.

Co-authored-by: Sean McGinnis <sean.mcginnis@gmail.com>
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -123,23 +123,23 @@ directory. The `certificate-authority` attribute contains the CA certificate and
Verify the expiry of these certificates:

```shell
openssl x509 -noout -dates -in $(kubectl config view --minify --output 'jsonpath={.clusters[0].cluster.certificate-authority}')
kubectl config view --flatten --output 'jsonpath={.clusters[0].cluster.certificate-authority-data}' | base64 -d | openssl x509 -noout -dates
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit)
I'd mention base64 in the page prerequisites. Also openssl, although it should have been there anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me how to best advise base64 and openssl as pre-requisites. base64 is part GNU core utilities and for openssl, as you suggest, should be already there...from my perspective, if you are this far in i.e. troubleshooting, both of these requirements would be implicitly met.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi - this is my first PR - is there something else that needs to be done for it to be merged? thankls.

Copy link
Contributor

@sftim sftim Apr 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me how to best advise base64 and openssl as pre-requisites. base64 is part GNU core utilities and for openssl, as you suggest, should be already there...from my perspective, if you are this far in i.e. troubleshooting, both of these requirements would be implicitly met.

Mention these in the prerequisites section.
This is a little like a recipe; a recipe for a meal might say something like:

  • preheat the oven to 220°C
  • you will need a steamer basket and an ovenproof metal bowl at least 15cm deep

[and a list of ingredients]

Even though cooks reading that recipe probably have an oven and the utensils, listing them all is helpful. If someone wanted to do troubleshooting and they don't have openssl, it's helpful for them to know that right from the start.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi - thanks for the suggestion. I considered putting into the prerequisites but given not all issues in this document required those tools, I thought some additional tooling in the TLS problems passage would be cleaner - however, this may not comply with the doc standard so I am also ok to move it into the prerequisites - just let us know.

@wushka00 wushka00 requested a review from sftim February 14, 2024 03:26
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Even better: also update the prerequisites section of the page to mention base64 (and might as well add openssl).

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

LGTM label has been added.

Git tree hash: 723ea01fdd7b212ec79c339017eae7e958ac3e4e

Included reference to additional tools in TLS problems.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 21, 2024
@k8s-ci-robot k8s-ci-robot requested a review from sftim April 21, 2024 04:37
@k8s-triage-robot
Copy link

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

This bot triages 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 PR is closed

You can:

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

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

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 20, 2024
```

```shell
openssl x509 -noout -dates -in $(kubectl config view --minify --output 'jsonpath={.users[0].user.client-certificate}')
kubectl config view --flatten --output 'jsonpath={.users[0].user.client-certificate-data}'| base64 -d | openssl x509 -noout -dates
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why's this better?

@sftim
Copy link
Contributor

sftim commented Jul 25, 2024

/retitle Fix advice about checking certificate expiry
/lgtm

@k8s-ci-robot k8s-ci-robot changed the title Update troubleshoot-kubectl.md Fix advice about checking certificate expiry Jul 25, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 25, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 147377161a91319120f6f86230412c7e026d9805

Copy link
Contributor

@divya-mohan0209 divya-mohan0209 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change @wushka00!

I'm approving the change since I find it to be technically sound, however, please could you respond to this comment by @sftim

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divya-mohan0209

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 Aug 12, 2024
@k8s-ci-robot k8s-ci-robot merged commit d902b65 into kubernetes:main Aug 12, 2024
6 checks passed
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. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants