What is the purpose of cluster-name parameter from kubernetes controller_manager?

3/2/2017

So the question is in the title.

I'm wondering what is the purpose of cluster-name parameter from kubernetes controller_manager?

-- cristi
kubernetes

2 Answers

3/2/2017

lets you create more than one cluster and helps you distinguish between them. Most folks just use kubernetes (which is the default) When you setup your kubectl you provide it as well.

this is from the k8s site @ https://kubernetes.io/docs/getting-started-guides/scratch/

You should pick a name for your cluster. Pick a short name for each cluster which is unique from future cluster names. This will be used in several ways:

  • by kubectl to distinguish between various clusters you have access to. You will probably want a second one sometime later, such as for testing new Kubernetes releases, running in a different region of the world, etc.
  • Kubernetes clusters can create cloud provider resources (e.g. AWS ELBs) and different clusters need to distinguish which resources each created. Call this CLUSTER_NAME
-- JamStar
Source: StackOverflow

3/2/2017

Reading the code of the cluster manager you'll find that the cluster-name is passed down to the service controller and the persistent volume controller which then pass them down to their related objects (Load balancers, persistent volumes, ...).

In both cases these pass down the cluster name to the related cloud provider (see interface) which could use it within the naming of their provider specific objects. This makes sense in case you run more than one Kubernetes cluster side by side on the same provider.

The GCE and AWS cloud providers do this for example, some others don't.

So having two clusters with the same cluster name configuration for the controller manager could therefore cause issues due to name collisions within the objects created by the cloud provider.

-- pagid
Source: StackOverflow