0

I use kubespray installed Kubernetes Cluster. I defined the cluster name as cluster.devops in the file, group_vars/k8s-cluster/k8s-cluster.yml. After the Kubernetes Cluster installed. the current-context in kube confi file is kubernetes-admin@cluster.devops. I would like the current-context is cluster.devops,

i.e. current-context is same as cluster name. How to do it?

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
Melissa Jenner
  • 781
  • 1
  • 8
  • 31

1 Answers1

1

you can rename context using

kubectl config rename-context old-name new-name

for example in your case

kubectl config rename-context kubernetes-admin@cluster.devops cluster.devops
Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102