|
| 1 | +{{- $defaultSelector := (include "external-dns.labelSelector" $ ) | fromYaml -}} |
1 | 2 | {{- $providerName := tpl (include "external-dns.providerName" .) $ }}
|
2 | 3 | apiVersion: apps/v1
|
3 | 4 | kind: Deployment
|
@@ -203,11 +204,67 @@ spec:
|
203 | 204 | {{- end }}
|
204 | 205 | {{- with .Values.affinity }}
|
205 | 206 | affinity:
|
206 |
| - {{- toYaml . | nindent 8 }} |
| 207 | + {{- with .podAffinity }} |
| 208 | + podAffinity: |
| 209 | + {{- with .preferredDuringSchedulingIgnoredDuringExecution }} |
| 210 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 211 | + {{- range . }} |
| 212 | + - podAffinityTerm: |
| 213 | + {{- if dig "podAffinityTerm" "labelSelector" nil . }} |
| 214 | + {{- toYaml .podAffinityTerm | nindent 16 }} |
| 215 | + {{- else }} |
| 216 | + {{- (merge $defaultSelector .podAffinityTerm) | toYaml | nindent 16 }} |
| 217 | + {{- end }} |
| 218 | + weight: {{ .weight }} |
| 219 | + {{- end }} |
| 220 | + {{- end }} |
| 221 | + {{- with .requiredDuringSchedulingIgnoredDuringExecution }} |
| 222 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 223 | + {{- range . }} |
| 224 | + {{- if dig "labelSelector" nil . }} |
| 225 | + - {{ toYaml . | indent 16 | trim }} |
| 226 | + {{- else }} |
| 227 | + - {{ (merge $defaultSelector .) | toYaml | indent 16 | trim }} |
| 228 | + {{- end }} |
| 229 | + {{- end }} |
| 230 | + {{- end }} |
| 231 | + {{- end }} |
| 232 | + {{- with .podAntiAffinity }} |
| 233 | + podAntiAffinity: |
| 234 | + {{- with .preferredDuringSchedulingIgnoredDuringExecution }} |
| 235 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 236 | + {{- range . }} |
| 237 | + - podAffinityTerm: |
| 238 | + {{- if dig "podAffinityTerm" "labelSelector" nil . }} |
| 239 | + {{- toYaml .podAffinityTerm | nindent 16 }} |
| 240 | + {{- else }} |
| 241 | + {{- (merge $defaultSelector .podAffinityTerm) | toYaml | nindent 16 }} |
| 242 | + {{- end }} |
| 243 | + weight: {{ .weight }} |
| 244 | + {{- end }} |
| 245 | + {{- end }} |
| 246 | + {{- with .requiredDuringSchedulingIgnoredDuringExecution }} |
| 247 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 248 | + {{- range . }} |
| 249 | + {{- if dig "labelSelector" nil . }} |
| 250 | + - {{ toYaml . | indent 16 | trim }} |
| 251 | + {{- else }} |
| 252 | + - {{ (merge $defaultSelector .) | toYaml | indent 16 | trim }} |
| 253 | + {{- end }} |
| 254 | + {{- end }} |
| 255 | + {{- end }} |
| 256 | + {{- end }} |
207 | 257 | {{- end }}
|
208 | 258 | {{- with .Values.topologySpreadConstraints }}
|
209 | 259 | topologySpreadConstraints:
|
210 |
| - {{- toYaml . | nindent 8 }} |
| 260 | + {{- range . }} |
| 261 | + - {{ toYaml . | nindent 10 | trim }} |
| 262 | + {{- if not (hasKey . "labelSelector") }} |
| 263 | + labelSelector: |
| 264 | + matchLabels: |
| 265 | + {{- include "external-dns.selectorLabels" $ | nindent 12 }} |
| 266 | + {{- end }} |
| 267 | + {{- end }} |
211 | 268 | {{- end }}
|
212 | 269 | {{- with .Values.tolerations }}
|
213 | 270 | tolerations:
|
|
0 commit comments