显示用户当前所处的集群名称。
kubectl config current-context
集群的 kubeconfig 文件中保存了当前集群的名称。
# 找出当前集群的名称 cat ~/.kube/config | grep current # 筛选掉无关字符,只保留名称 cat ~/.kube/config | grep current | sed -e "s/current-context: //"
← kubectl config use-context kubectl config set-credentials→