File tree Expand file tree Collapse file tree
tasks/access-application-cluster Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,18 +58,21 @@ kubectl config view # Show Merged kubeconfig settings.
5858# use multiple kubeconfig files at the same time and view merged config
5959KUBECONFIG=~ /.kube/config:~ /.kube/kubconfig2 kubectl config view
6060
61- # Get the password for the e2e user
61+ # get the password for the e2e user
6262kubectl config view -o jsonpath=' {.users[?(@.name == "e2e")].user.password}'
6363
64- kubectl config current-context # Display the current-context
65- kubectl config use-context my-cluster-name # set the default context to my-cluster-name
64+ kubectl config view -o jsonpath=' {.users[].name}' # get a list of users
65+ kubectl config current-context # display the current-context
66+ kubectl config use-context my-cluster-name # set the default context to my-cluster-name
6667
6768# add a new cluster to your kubeconf that supports basic auth
6869kubectl config set-credentials kubeuser/foo.kubernetes.com --username=kubeuser --password=kubepassword
6970
7071# set a context utilizing a specific username and namespace.
7172kubectl config set-context gce --user=cluster-admin --namespace=foo \
7273 && kubectl config use-context gce
74+
75+ kubectl config unset users.foo # delete user foo
7376```
7477
7578## Creating Objects
Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ kubectl config --kubeconfig=config-demo set-credentials developer --client-certi
8585kubectl config --kubeconfig=config-demo set-credentials experimenter --username=exp --password=some-password
8686```
8787
88+ {{< note >}}
89+ To delete a user you can run ` kubectl config unset users.<name> `
90+ {{< /note >}}
91+
8892Add context details to your configuration file:
8993
9094``` shell
You can’t perform that action at this time.
0 commit comments