Skip to content

controlPlane InstanceGroup must have maxSize set to 1, add more InstanceGroups instead #17246

Open
@arpanadhikari

Description

@arpanadhikari

I'm trying to create a kOps cluster on single AZ in AWS (to avoid inter AZ data transfer costs). Single AZ is enough to meet our availability requirements.

However, I still need more than one master node so I scaled up my instanceGroup to have minSize:3 and maxSize:3 on the existing master instanceGroup spec. However, kOps appears to have a built in limitation on using only one instance per instanceGroup for master nodes.

if fi.ValueOf(g.Spec.MinSize) > 1 {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "minSize"), fi.ValueOf(g.Spec.MinSize), "controlPlane InstanceGroup must have minSize set to 1"))
}
if fi.ValueOf(g.Spec.MaxSize) > 1 {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "maxSize"), fi.ValueOf(g.Spec.MaxSize), "controlPlane InstanceGroup must have maxSize set to 1, add more InstanceGroups instead"))

I could create multiple instanceGroups on the same AZ but that would mean duplicating the same config and also it just doesn't make sense.

Any advise/workarounds welcome. Happy to make a pull request to fix it if required.

My configuration:

# master instance group snippet
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
  labels:
    kops.k8s.io/cluster: {{.kops.clusterName}}.{{.kops.dnsZone}}
  name: masters
spec:
  image: {{ ChannelRecommendedImage .kops.cloudProvider .kops.kubernetesVersion .kops.architecture }}
  kubernetesVersion: {{.kops.kubernetesVersion}}
  machineType: {{ .kops.masters.machineType }}
  {{ if .kops.masters.spot }}
  maxPrice: {{ .kops.masters.maxPrice | quote }}
  {{ end }}
  maxSize: 3
  minSize: 3
  role: Master
  rootVolumeSize: 80
  subnets:
  - {{.kops.awsRegion}}a
---

# etcd config snippet
  etcdClusters:
  - cpuRequest: 200m
    etcdMembers:
    - encryptedVolume: true
      instanceGroup: masters
      name: a
    - encryptedVolume: true
      instanceGroup: masters
      name: b
    - encryptedVolume: true
      instanceGroup: masters
      name: c

Also, Is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions