Skip to content

Commit 71d493b

Browse files
authored
Update troubleshoot-kubectl.md
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
1 parent 5f4ccd5 commit 71d493b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,23 @@ directory. The `certificate-authority` attribute contains the CA certificate and
123123
Verify the expiry of these certificates:
124124

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

129129
output:
130130
```console
131-
notBefore=Sep 2 08:34:12 2023 GMT
132-
notAfter=Aug 31 08:34:12 2033 GMT
131+
notBefore=Feb 13 05:57:47 2024 GMT
132+
notAfter=Feb 10 06:02:47 2034 GMT
133133
```
134134

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

139139
output:
140140
```console
141-
notBefore=Sep 2 08:34:12 2023 GMT
142-
notAfter=Sep 2 08:34:12 2026 GMT
141+
notBefore=Feb 13 05:57:47 2024 GMT
142+
notAfter=Feb 12 06:02:50 2025 GMT
143143
```
144144

145145
## Verify kubectl helpers
@@ -155,4 +155,4 @@ kubectl config view
155155
```
156156

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

0 commit comments

Comments
 (0)