How do I delete clusters and contexts from kubectl config?

前端 未结 4 1052
生来不讨喜
生来不讨喜 2021-01-30 00:49

kubectl config view shows contexts and clusters corresponding to clusters that I have deleted.

How can I remove those entries?

The command



        
4条回答
  •  鱼传尺愫
    2021-01-30 01:10

    For clusters and contexts you can also do

    kubectl config delete-cluster my-cluster
    
    kubectl config delete-context my-cluster-context
    

    There's nothing specific for users though, so you still have to do

    kubectl config unset users.my-cluster-admin
    

提交回复
热议问题