Skip to content

Commit b4683eb

Browse files
authored
Merge pull request #43652 from berry2012/main
added commands to cheatsheet.md
2 parents dfc0c66 + 7d987ff commit b4683eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

content/en/docs/reference/kubectl/quick-reference.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,19 @@ KUBECONFIG=~/.kube/config:~/.kube/kubconfig2
7171

7272
kubectl config view
7373

74+
# Show merged kubeconfig settings and raw certificate data and exposed secrets
75+
kubectl config view --raw
76+
7477
# get the password for the e2e user
7578
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
7679

80+
# get the certificate for the e2e user
81+
kubectl config view --raw -o jsonpath='{.users[?(.name == 'e2e')].user.client-certificate-data}' | base64 -d
82+
7783
kubectl config view -o jsonpath='{.users[].name}' # display the first user
7884
kubectl config view -o jsonpath='{.users[*].name}' # get a list of users
7985
kubectl config get-contexts # display list of contexts
86+
kubectl config get-contexts -o name # get all context names
8087
kubectl config current-context # display the current-context
8188
kubectl config use-context my-cluster-name # set the default context to my-cluster-name
8289

0 commit comments

Comments
 (0)