Skip to content

Commit d902b65

Browse files
authored
Merge pull request #45127 from wushka00/patch-1
Fix advice about checking certificate expiry
2 parents 96351bc + 6ea1067 commit d902b65

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

content/en/docs/tasks/debug/debug-cluster/troubleshoot-kubectl.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ Verify the status of the load balancer (if used) to ensure it is healthy and for
112112
traffic to the API server.
113113

114114
## TLS problems
115+
* Additional tools required - `base64` and `openssl` version 3.0 or above.
115116

116117
The Kubernetes API server only serves HTTPS requests by default. In that case TLS problems
117118
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
123124
Verify the expiry of these certificates:
124125

125126
```shell
126-
openssl x509 -noout -dates -in $(kubectl config view --minify --output 'jsonpath={.clusters[0].cluster.certificate-authority}')
127+
kubectl config view --flatten --output 'jsonpath={.clusters[0].cluster.certificate-authority-data}' | base64 -d | openssl x509 -noout -dates
127128
```
128129

129130
output:
130131
```console
131-
notBefore=Sep 2 08:34:12 2023 GMT
132-
notAfter=Aug 31 08:34:12 2033 GMT
132+
notBefore=Feb 13 05:57:47 2024 GMT
133+
notAfter=Feb 10 06:02:47 2034 GMT
133134
```
134135

135136
```shell
136-
openssl x509 -noout -dates -in $(kubectl config view --minify --output 'jsonpath={.users[0].user.client-certificate}')
137+
kubectl config view --flatten --output 'jsonpath={.users[0].user.client-certificate-data}'| base64 -d | openssl x509 -noout -dates
137138
```
138139

139140
output:
140141
```console
141-
notBefore=Sep 2 08:34:12 2023 GMT
142-
notAfter=Sep 2 08:34:12 2026 GMT
142+
notBefore=Feb 13 05:57:47 2024 GMT
143+
notAfter=Feb 12 06:02:50 2025 GMT
143144
```
144145

145146
## Verify kubectl helpers
@@ -155,4 +156,4 @@ kubectl config view
155156
```
156157

157158
If you previously used a helper tool (for example, `kubectl-oidc-login`), ensure that it is still
158-
installed and configured correctly.
159+
installed and configured correctly.

0 commit comments

Comments
 (0)