Chart: Make pod affinity templatable. (#11453)

* [helm] template pod affinity

* update README

* Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* revert Chart.yaml version bump

* add unittests

* add docs defaultBackend.affinity

* add README section to values

* fix README syntax

* Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* Update charts/ingress-nginx/values.yaml

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* update formatting of unittests + add README examples

* fix affinity labels on default-backend

* Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* remove double quotes on string

---------

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
This commit is contained in:
TheRealNoob 2024-06-14 02:13:44 -07:00 committed by GitHub
parent 8ca27e7ee9
commit af9e5246ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 179 additions and 9 deletions

View file

@ -260,11 +260,11 @@ controller:
# - key: app.kubernetes.io/name
# operator: In
# values:
# - ingress-nginx
# - '{{ include "ingress-nginx.name" . }}'
# - key: app.kubernetes.io/instance
# operator: In
# values:
# - ingress-nginx
# - '{{ .Release.Name }}'
# - key: app.kubernetes.io/component
# operator: In
# values:
@ -279,16 +279,16 @@ controller:
# - key: app.kubernetes.io/name
# operator: In
# values:
# - ingress-nginx
# - '{{ include "ingress-nginx.name" . }}'
# - key: app.kubernetes.io/instance
# operator: In
# values:
# - ingress-nginx
# - '{{ .Release.Name }}'
# - key: app.kubernetes.io/component
# operator: In
# values:
# - controller
# topologyKey: "kubernetes.io/hostname"
# topologyKey: kubernetes.io/hostname
# -- Topology spread constraints rely on node labels to identify the topology domain(s) that each Node is in.
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
@ -1011,7 +1011,49 @@ defaultBackend:
# value: "value"
# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
# -- Affinity and anti-affinity rules for server scheduling to nodes
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity: {}
# # An example of preferred pod anti-affinity, weight is in the range 1-100
# podAntiAffinity:
# preferredDuringSchedulingIgnoredDuringExecution:
# - weight: 100
# podAffinityTerm:
# labelSelector:
# matchExpressions:
# - key: app.kubernetes.io/name
# operator: In
# values:
# - '{{ include "ingress-nginx.name" . }}'
# - key: app.kubernetes.io/instance
# operator: In
# values:
# - '{{ .Release.Name }}'
# - key: app.kubernetes.io/component
# operator: In
# values:
# - default-backend
# topologyKey: kubernetes.io/hostname
# # An example of required pod anti-affinity
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: app.kubernetes.io/name
# operator: In
# values:
# - '{{ include "ingress-nginx.name" . }}'
# - key: app.kubernetes.io/instance
# operator: In
# values:
# - '{{ .Release.Name }}'
# - key: app.kubernetes.io/component
# operator: In
# values:
# - default-backend
# topologyKey: kubernetes.io/hostname
# -- Topology spread constraints rely on node labels to identify the topology domain(s) that each Node is in.
# Ref.: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
topologySpreadConstraints: []