Add a note on how to delete kubectl config user name (#13257)
This commit is contained in:
parent
b1634fcc1c
commit
ad77c02575
|
@ -58,10 +58,11 @@ kubectl config view # Show Merged kubeconfig settings.
|
|||
# use multiple kubeconfig files at the same time and view merged config
|
||||
KUBECONFIG=~/.kube/config:~/.kube/kubconfig2 kubectl config view
|
||||
|
||||
# Get the password for the e2e user
|
||||
# get the password for the e2e user
|
||||
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
|
||||
|
||||
kubectl config current-context # Display the current-context
|
||||
kubectl config view -o jsonpath='{.users[].name}' # get a list of users
|
||||
kubectl config current-context # display the current-context
|
||||
kubectl config use-context my-cluster-name # set the default context to my-cluster-name
|
||||
|
||||
# add a new cluster to your kubeconf that supports basic auth
|
||||
|
@ -70,6 +71,8 @@ kubectl config set-credentials kubeuser/foo.kubernetes.com --username=kubeuser -
|
|||
# set a context utilizing a specific username and namespace.
|
||||
kubectl config set-context gce --user=cluster-admin --namespace=foo \
|
||||
&& kubectl config use-context gce
|
||||
|
||||
kubectl config unset users.foo # delete user foo
|
||||
```
|
||||
|
||||
## Creating Objects
|
||||
|
|
|
@ -85,6 +85,10 @@ kubectl config --kubeconfig=config-demo set-credentials developer --client-certi
|
|||
kubectl config --kubeconfig=config-demo set-credentials experimenter --username=exp --password=some-password
|
||||
```
|
||||
|
||||
{{< note >}}
|
||||
To delete a user you can run `kubectl config unset users.<name>`
|
||||
{{< /note >}}
|
||||
|
||||
Add context details to your configuration file:
|
||||
|
||||
```shell
|
||||
|
|
Loading…
Reference in New Issue