Created
October 25, 2018 10:53
-
-
Save joerx/5bac5f751f0c6ac3b41bcff256e578e4 to your computer and use it in GitHub Desktop.
inspect kubeconfig client cert
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
#!/bin/sh | |
# Kubeconfig contains client keys and certs in base64 encoded form. The command below will decode the cert and show the plaintext output | |
# Note: 'yq' is a yaml wrapper around the awesome 'jq' - https://yq.readthedocs.io/en/latest/ | |
# If anybody has an idea how to get kubeconfig output _including_ certs in json, let me know | |
cat ~/.kube/config | yq -r '.users[] | select(.name == "ap-southeast-1b.staging.kube.honestbee.com").user["client-certificate-data"]' | base64 -D | openssl x509 -text -noout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment