1 {{/* vim: set filetype=mustache: */}}
4 Return a soft nodeAffinity definition
5 {{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
7 {{- define "common.affinities.nodes.soft" -}}
8 preferredDuringSchedulingIgnoredDuringExecution:
21 Return a hard nodeAffinity definition
22 {{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}}
24 {{- define "common.affinities.nodes.hard" -}}
25 requiredDuringSchedulingIgnoredDuringExecution:
37 Return a nodeAffinity definition
38 {{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
40 {{- define "common.affinities.nodes" -}}
41 {{- if eq .type "soft" }}
42 {{- include "common.affinities.nodes.soft" . -}}
43 {{- else if eq .type "hard" }}
44 {{- include "common.affinities.nodes.hard" . -}}
49 Return a soft podAffinity/podAntiAffinity definition
50 {{ include "common.affinities.pods.soft" (dict "component" "FOO" "context" $) -}}
52 {{- define "common.affinities.pods.soft" -}}
53 {{- $component := default "" .component -}}
54 preferredDuringSchedulingIgnoredDuringExecution:
57 matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 10 }}
58 {{- if not (empty $component) }}
59 {{ printf "app.kubernetes.io/component: %s" $component }}
62 - {{ .context.Release.Namespace }}
63 topologyKey: kubernetes.io/hostname
68 Return a hard podAffinity/podAntiAffinity definition
69 {{ include "common.affinities.pods.hard" (dict "component" "FOO" "context" $) -}}
71 {{- define "common.affinities.pods.hard" -}}
72 {{- $component := default "" .component -}}
73 requiredDuringSchedulingIgnoredDuringExecution:
75 matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 8 }}
76 {{- if not (empty $component) }}
77 {{ printf "app.kubernetes.io/component: %s" $component }}
80 - {{ .context.Release.Namespace }}
81 topologyKey: kubernetes.io/hostname
85 Return a podAffinity/podAntiAffinity definition
86 {{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}}
88 {{- define "common.affinities.pods" -}}
89 {{- if eq .type "soft" }}
90 {{- include "common.affinities.pods.soft" . -}}
91 {{- else if eq .type "hard" }}
92 {{- include "common.affinities.pods.hard" . -}}