Skip to content

Commit

Permalink
Adding support for multiple MachinePools
Browse files Browse the repository at this point in the history
Signed-off-by: Archisman <archisman@obmondo.com>
  • Loading branch information
Archisman committed Sep 4, 2024
1 parent 67bcc1a commit 8e027ee
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{{- if (.Values.global.capa).autoScaler }}
{{- range $index, $machinePool := $.Values.machinePools }}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: AWSMachinePool
metadata:
name: {{ .Values.global.clusterName }}-mp-0
name: {{ printf "%s-%s" $.Values.global.clusterName $machinePool.name }}
spec:
minSize: {{ .Values.workerNodes.minSize | default 1 }}
maxSize: {{ .Values.workerNodes.maxSize | default 3 }}
minSize: {{ $machinePool.minSize | default 1 }}
maxSize: {{ $machinePool.maxSize | default 3 }}
awsLaunchTemplate:
ami: {{ toYaml .Values.workerNodes.ami | nindent 6 }}
ami: {{ toYaml $machinePool.ami | nindent 6 }}
iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io
instanceType: {{ .Values.workerNodes.instanceType }}
sshKeyName: {{ .Values.workerNodes.sshKeyName }}
instanceType: {{ $machinePool.instanceType }}
sshKeyName: {{ $machinePool.sshKeyName }}
imageLookupBaseOS: ubuntu-20.04
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
{{- if (.Values.global.capa).autoScaler }}
{{- range $index, $machinePool := $.Values.machinePools }}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
name: {{ .Values.global.clusterName }}-mp-0
name: {{ printf "%s-%s" $.Values.global.clusterName $machinePool.name }}
spec:
clusterName: {{ .Values.global.clusterName }}
replicas: {{ .Values.workerNodes.replicas }}
clusterName: {{ $.Values.global.clusterName }}
replicas: {{ $machinePool.replicas }}
template:
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfig
name: {{ .Values.global.clusterName }}
clusterName: {{ .Values.global.clusterName }}
name: {{ $.Values.global.clusterName }}
clusterName: {{ $.Values.global.clusterName }}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: AWSMachinePool
name: {{ .Values.global.clusterName }}-mp-0
version: {{ .Values.global.kubernetes.version }}
name: {{ printf "%s-%s" $.Values.global.clusterName $machinePool.name }}
version: {{ $.Values.global.kubernetes.version }}
{{- end }}
{{- end }}
38 changes: 30 additions & 8 deletions argocd-helm-charts/capi-cluster/charts/aws/values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
workerNodes:
maxSize: 3
minSize: 1
ami:
id: ami-03cd26c84ae9a587c
publicIP: false
secretName: capi-cluster-token
sshKeyName: kubeaid-demo
region: us-east-2
bastion:
enabled: true
vpc:
cidrBlock: 10.14.0.0/22
pods:
cidrBlock: 10.244.0.0/16

controlPlane:
loadBalancerType: nlb
region: us-east-2
replicas: 1
instanceType: t2.medium
ami:
id: ami-03cd26c84ae9a587c
publicIP: true
id: ami-05145146e3a9db6f3

machinePools:
- name: primary
replicas: 1
region: us-east-2
instanceType: t2.medium
sshKeyName: kubeaid-demo
ami:
id: ami-05145146e3a9db6f3
- name: secondary
replicas: 1
instanceType: t2.medium
sshKeyName: kubeaid-demo
ami:
id: ami-05145146e3a9db6f3
1 change: 0 additions & 1 deletion argocd-helm-charts/capi-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ global:
capz:
version: v1.16.0


selfManged: false

provider:
Expand Down

0 comments on commit 8e027ee

Please sign in to comment.