-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,7 @@ Verify the status of the load balancer (if used) to ensure it is healthy and for | |
traffic to the API server. | ||
|
||
## TLS problems | ||
* Additional tools required - `base64` and `openssl` version 3.0 or above. | ||
|
||
The Kubernetes API server only serves HTTPS requests by default. In that case TLS problems | ||
may occur due to various reasons, such as certificate expiry or chain of trust validity. | ||
|
@@ -123,23 +124,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 | ||
``` | ||
|
||
output: | ||
```console | ||
notBefore=Sep 2 08:34:12 2023 GMT | ||
notAfter=Aug 31 08:34:12 2033 GMT | ||
notBefore=Feb 13 05:57:47 2024 GMT | ||
notAfter=Feb 10 06:02:47 2034 GMT | ||
``` | ||
|
||
```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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why's this better? |
||
``` | ||
|
||
output: | ||
```console | ||
notBefore=Sep 2 08:34:12 2023 GMT | ||
notAfter=Sep 2 08:34:12 2026 GMT | ||
notBefore=Feb 13 05:57:47 2024 GMT | ||
notAfter=Feb 12 06:02:50 2025 GMT | ||
``` | ||
|
||
## Verify kubectl helpers | ||
|
@@ -155,4 +156,4 @@ kubectl config view | |
``` | ||
|
||
If you previously used a helper tool (for example, `kubectl-oidc-login`), ensure that it is still | ||
installed and configured correctly. | ||
installed and configured correctly. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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. Alsoopenssl
, although it should have been there anyway.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention these in the prerequisites section.
This is a little like a recipe; a recipe for a meal might say something like:
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.There was a problem hiding this comment.
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.