-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best practice of setting the cluster name at deployment level #10066
Comments
This is a duplicate of #4610 Clusters don't know their own name, there is no field within the cluster itself to store that data. If you want the kubeconfig to reflect a different name, your best option is to make that edit when collecting the admin kubeconfig off the server nodes, or (preferably) when generating unique kubeconfigs for your users with distinct users and RBAC. |
Thank you @brandond for providing the clarifications. I was simply trying to understand how the |
We've discussed it in the past and decided against it. The admin kubeconfig really shouldn't be used for much other that locally interacting with the server. If you're managing multiple clusters to the point where you want to give their contexts unique names in your kubeconfig, you should be using more advanced tooling for that - and not using the default admin kubeconfig and admin RBAC. |
Thank you, it makes sense now. |
Environmental Info:
K3s Version:
v1.29.4+k3s1 (94e29e2e)
Node(s) CPU architecture, OS, and Version:
Cluster Configuration:
3 servers, 5 agents
Describe the bug:
My goal is to deploy 2 K3s clusters and set a distinct name for each cluster. Current configuration on both clusters, please note the
default
name:Ideally, I want to have the clusters named
development
andproduction
.K3s generates the
/etc/rancher/k3s/k3s.yaml
file, where the cluster name is present. I looked at the documentation and there is no setting allowing me to define the cluster name, on initial cluster deployment. How is thedefault
name defined intok3s.yaml
file?I understand the end-user will configure their
/.kube/config
file the way they want, but I would like to have some sort of--cluster-name
switch allowing us to define the cluster name, at deployment level.Thank you.
The text was updated successfully, but these errors were encountered: