From a113f5cb6d22f69883e7a706daad051105edfec9 Mon Sep 17 00:00:00 2001 From: Devesh Sharma Date: Wed, 28 Aug 2024 21:49:32 +0530 Subject: [PATCH] Added loop for machineDeployment Signed-off-by: Devesh Sharma --- .../azure/templates/MachineDeployment.yaml | 58 +------------------ 1 file changed, 3 insertions(+), 55 deletions(-) diff --git a/argocd-helm-charts/capi-cluster/charts/azure/templates/MachineDeployment.yaml b/argocd-helm-charts/capi-cluster/charts/azure/templates/MachineDeployment.yaml index 2ae947a0c..deb1694a5 100644 --- a/argocd-helm-charts/capi-cluster/charts/azure/templates/MachineDeployment.yaml +++ b/argocd-helm-charts/capi-cluster/charts/azure/templates/MachineDeployment.yaml @@ -1,8 +1,9 @@ {{- if .Values.selfManagedCluster.enabled }} +{{- range $index, $element := until 3 }} apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment metadata: - name: {{ .Values.global.clusterName }}-md-0 + name: {{ .Values.global.clusterName }}-md-{{ $index }} namespace: {{ .Release.Namespace }} spec: clusterName: {{ .Values.global.clusterName }} @@ -22,59 +23,6 @@ spec: kind: AzureMachineTemplate name: {{ .Values.global.clusterName }}-system version: {{ .Values.global.kubernetes.version }} - failureDomain: "1" + failureDomain: "{{ add $index 1 }}" {{- end }} ---- -{{- if .Values.selfManagedCluster.enabled }} -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: {{ .Values.global.clusterName }}-md-1 - namespace: {{ .Release.Namespace }} -spec: - clusterName: {{ .Values.global.clusterName }} - replicas: 1 - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: {{ .Values.global.clusterName }}-md-0 - clusterName: {{ .Values.global.clusterName }} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureMachineTemplate - name: {{ .Values.global.clusterName }}-system - version: {{ .Values.global.kubernetes.version }} - failureDomain: "2" -{{- end }} ---- -{{- if .Values.selfManagedCluster.enabled }} -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: {{ .Values.global.clusterName }}-md-2 - namespace: {{ .Release.Namespace }} -spec: - clusterName: {{ .Values.global.clusterName }} - replicas: 1 - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: {{ .Values.global.clusterName }}-md-0 - clusterName: {{ .Values.global.clusterName }} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureMachineTemplate - name: {{ .Values.global.clusterName }}-system - version: {{ .Values.global.kubernetes.version }} - failureDomain: "3" {{- end }}