Skip to content

Commit

Permalink
Added loop for machineDeployment
Browse files Browse the repository at this point in the history
Signed-off-by: Devesh Sharma <devesh@obmondo.com>
  • Loading branch information
Devesh Sharma committed Aug 28, 2024
1 parent 03274d7 commit a113f5c
Showing 1 changed file with 3 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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 }}

0 comments on commit a113f5c

Please sign in to comment.