I was following a tutorial on kubernetes and it told me to run the following commands:
kubectl config set-cluster --server=http://127.0.0.1:8080
kubectl config set-context local --cluster=local
kubectl config use-context local
Now when I run kubectl config view
I see an entry for local:
contexts:
- context:
cluster: local
user: ""
name: local
I was kind of curious about this so I ran the following command:
kubectl config set-context testorz --cluster=local
Now I see that when I run kubectl config view
How do I remove my "testorz" context?
You can quickly switch between clusters by using the kubectl config use-context command. To use that command, though, you need to configure contexts in your kubeconfig. This can be done with the kubectl config set-context command.
KUBECONFIG and Context – The Theory When you first setup your Kubernetes cluster you created a config file likely stored in your $HOME/. kube directory. This is the KUBECONFIG file and it is used to store information about your connection to the Kubernetes cluster.
A Kubernetes context is used to group access parameters under an easily recognizable name in a kubeconfig file – a file used to configure access to clusters. It is the connection to a particular cluster used by kubectl. This concept only applies in the place where the kubectl command is run.
You can delete a StatefulSet in the same way you delete other resources in Kubernetes: use the kubectl delete command, and specify the StatefulSet either by file or by name. You may need to delete the associated headless service separately after the StatefulSet itself is deleted.
You can kubectl config unset contexts.testorz
to remove that entry.
See http://kubernetes.io/docs/user-guide/kubectl/kubectl_config_unset/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With