Assuming your config file is at $KUBECONFIG (default ~/.kube/config) follow these steps to remove clusters/contexts/users from it:
- get clusters and contexts in the config
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* development-cluster arn:aws:eks:sp-antarctica-1:012345678901:cluster/development-cluster arn:aws:eks:sp-antarctica-1:012345678901:cluster/development-cluster default
production-cluster arn:aws:eks:sp-antarctica-1:098765432109:cluster/production-cluster arn:aws:eks:sp-antarctica-1:098765432109:cluster/production-cluster default
Under NAME is the context name, under CLUSTER is the cluster name, very straightforward
- remove a cluster/context/user
$ kubectl config delete-cluster arn:aws:eks:sp-antarctica-1:012345678901:cluster/development-cluster
$ kubectl config delete-context development-cluster
$ kubectl config unset users.arn:aws:eks:sp-antarctica-1:012345678901:cluster/development-cluster