By default, all the Kubernetes clusters details are stored in the user’s home directory in a kube config file ($HOME/.kube/config). As you keep on adding new cluster contexts, the file becomes bigger. If you want to remove a cluster from the contexts, follow the steps given below.
First of all get the list of all the contexts stored in the kube config file. Identify the one you want to remove.
$ kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE * kind-kind kind-kind kind-kind
Let us remove kind-kind contexts from the kube config file.
$ kubectl config unset users.kind-kind $ kubectl config unset contexts.kind-kind $ kubectl config unset clusters.kind-kind
You should no longer see the context kind-kind.