Hi Jaejong

The kuberneres/cks cluster created in Cloudstack are created via Kubeadm tool 
which always creates with the default name as kubernetes

You can rename the cluster  as per your requirement by following this article


https://medium.com/@manumv1/how-to-rename-a-kubernetes-cluster-c10db35d92aa


From kubectl perspective your kubernetes cluster can be named totally 
differently than in kubeadm-config ConfigMap. They are configured 
independently. Actually in .kube/config file you can refer to your cluster by 
any name you want, but you need to make the change both in clusters as well as 
in contexts sections.


Also you can reach out to the kubeadm community to cross check if they can 
support specifying a name during k8s cluster creation

https://github.com/kubernetes/kubeadm/issues/416



Regards
Kiran

From: jaejong <cb...@naver.com>
Date: Monday, 15 April 2024 at 5:53 AM
To: users@cloudstack.apache.org <users@cloudstack.apache.org>
Subject: How to kcs cluster name with supplied name?
I create kcs community iso 1.28.4 on acs 4.19.0.1.

I create two clusters. The cluster name is not populated to Config.
In cluster kubeconfig, cluster name is kubernetes  and user is kubernetes-admin.
So I can not merge two into one.

I remember it is possible in previous version.

kubeconfig is created with the name I supplied when  create kubernetes cluster 
such as:
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: ...
    server: https://x.x.x.x:6443
  name: supplied-name
contexts:
- context:
    cluster: supplied-name
    user: supplied-name-admin
  name: supplied-name-admin@kubernetes
kind: Config
preferences: {}
users:
- name: supplied-name-admin
  user:----
So I can distingush two clusters.

Is there any way I can change cluster name in  kubeconfig?

 

Reply via email to