Merge "HTK: Update kubernetes_pod_anti_affinity function"

This commit is contained in:
Zuul 2019-05-15 19:38:26 +00:00 committed by Gerrit Code Review
commit 28fb847ab1
1 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,8 @@ values: |
default: kubernetes.io/hostname
type:
default: requiredDuringSchedulingIgnoredDuringExecution
weight:
default: 10
usage: |
{{ tuple . "appliction_x" "component_y" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" }}
return: |
@ -74,7 +76,11 @@ podAntiAffinity:
matchExpressions:
{{ $matchExpressions | indent 10 }}
topologyKey: {{ $antiAffinityKey }}
{{- if $envAll.Values.pod.affinity.anti.weight }}
weight: {{ index $envAll.Values.pod.affinity.anti.weight $component | default $envAll.Values.pod.affinity.anti.weight.default }}
{{- else }}
weight: 10
{{- end -}}
{{- else if eq $antiAffinityType "requiredDuringSchedulingIgnoredDuringExecution" }}
{{ $antiAffinityType }}:
- labelSelector: