diff --git a/argocd-helm-charts/capi-cluster/charts/aws/templates/KubeadmConfig.yaml b/argocd-helm-charts/capi-cluster/charts/aws/templates/KubeadmConfig.yaml index ca7e9964b..7d46812ed 100644 --- a/argocd-helm-charts/capi-cluster/charts/aws/templates/KubeadmConfig.yaml +++ b/argocd-helm-charts/capi-cluster/charts/aws/templates/KubeadmConfig.yaml @@ -11,5 +11,8 @@ spec: kubeletExtraArgs: cloud-provider: external name: '{{"{{"}} ds.meta_data.local_hostname {{"}}"}}' + {{- if $machinePool.taints }} + taints: {{- toYaml $machinePool.taints | nindent 8 }} + {{- end }} {{- end }} {{- end }} diff --git a/argocd-helm-charts/capi-cluster/charts/aws/templates/MachinePool.yaml b/argocd-helm-charts/capi-cluster/charts/aws/templates/MachinePool.yaml index cd080fe34..b43dc9f96 100644 --- a/argocd-helm-charts/capi-cluster/charts/aws/templates/MachinePool.yaml +++ b/argocd-helm-charts/capi-cluster/charts/aws/templates/MachinePool.yaml @@ -9,12 +9,17 @@ spec: clusterName: {{ $.Values.global.clusterName }} replicas: {{ $machinePool.replicas }} template: + {{- if $machinePool.labels }} metadata: - labels: - machine-pool: {{ printf "%s-%s" $.Values.global.clusterName $machinePool.name }} - {{- if $machinePool.labels }} - {{- toYaml $machinePool.labels | nindent 8 }} - {{- end }} + # Label should meet one of the following criterias to propagate to Node : + # + # (1) Has node-role.kubernetes.io as prefix. + # (2) Belongs to node-restriction.kubernetes.io domain. + # (3) Belongs to node.cluster.x-k8s.io domain. + # + # REFER : https://cluster-api.sigs.k8s.io/developer/architecture/controllers/metadata-propagation#machine + labels: {{- toYaml $machinePool.labels | nindent 8 }} + {{- end }} spec: bootstrap: configRef: