Skip to content
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

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

Open
arpanadhikari opened this issue Feb 3, 2025 · 0 comments

Comments

@arpanadhikari
Copy link

arpanadhikari commented Feb 3, 2025

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?

@arpanadhikari arpanadhikari changed the title Minimum size of controlplane instance group controlPlane InstanceGroup must have maxSize set to 1, add more InstanceGroups instead Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant