Kubernetes with Kops is it correct to have each master in its own instance group?

11/19/2018

When I create a Kubernetes cluster and specify the --master-zone us-west-2a,us-west2b-us-west2c I end up with 3 masters (which is fine) but they are in different instance groups.

i.e.

$ kops get ig 
Using cluster from kubectl context: kube2.mydomain.net

NAME            ROLE    MACHINETYPE MIN MAX ZONES
master-us-west-2a   Master  m4.large    1   1   us-west-2a
master-us-west-2b   Master  m4.large    1   1   us-west-2b
master-us-west-2c   Master  m4.large    1   1   us-west-2c
nodes           Node    m4.large    3   3   us-west-2a,us-west-2b,us-west-2c

I'm not sure this is correct, or is this a best practice?

I would think that all the masters should be in one instance group.

-- Edgar Martinez
kops
kubernetes

1 Answer

11/19/2018

I'm assuming you mean multiple availability zones. This is the default behavior for redundancy. Cloud providers like AWS recommend spreading your control plane (and your workloads for that matter) among different availability zones.

If you want to create them in a single zone you can run something like this, for example:

$ kops create cluster --zones=us-east-1c --master-count=3 k8s.example.com

Or

$ kops create cluster --zones=us-east-1b,us-east-1c --master-zones=us-east-1c --master-count=3

More info here.

I believe the rationale behind having an instance group (that map to ASGs in AWS) is that if you specify multiple availability zones in an ASG there are no guarantees that the nodes will land in a way that there is one on each availability zone.

-- Rico
Source: StackOverflow