How do I delete clusters and contexts from kubectl config?

前端 未结 4 1060
生来不讨喜
生来不讨喜 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:19

    Run command below to get all contexts you have:

    $ kubectl config get-contexts
    
    CURRENT   NAME             CLUSTER     AUTHINFO                                NAMESPACE
    
    *         Cluster_Name_1   Cluster_1   clusterUser_resource-group_Cluster_1
    

    Delete context:

     $ kubectl config delete-context Cluster_Name_1
    

提交回复
热议问题