diff --git a/CHANGELOG.md b/CHANGELOG.md index b6382e4a..cf2c191b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented here. +### v2.2.0 +- Feature: Add topologySpreadConstraints [PR-239](https://github.com/stakater/application/pull/239) + ### v2.1.9 - Fix: Make servicePort var override possible with ingress hosts [PR-243](https://github.com/stakater/application/pull/243) diff --git a/README.md b/README.md index bdb229ba..f7902973 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ To uninstall the chart: | deployment.args | Arg for primary container of deployment | `[]` | | deployment.tolerations | Taint tolerations for nodes | `[]` | | deployment.affinity | Affinity for pod/node | `[]` | +| deployment.topologySpreadConstraints| Topology spread constraints definitions | `[]` | | deployment.ports | Ports for primary container | `[]` | | deployment.securityContext | Security Context for the pod | `{}` | | deployment.additionalContainers | Add additional containers besides init and app containers | `[]` | diff --git a/application/templates/deployment.yaml b/application/templates/deployment.yaml index 62c8bfd8..e6673cc6 100644 --- a/application/templates/deployment.yaml +++ b/application/templates/deployment.yaml @@ -93,6 +93,10 @@ spec: affinity: {{ toYaml .Values.deployment.affinity | indent 8 -}} {{- end }} + {{- with .Values.deployment.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} {{- if .Values.deployment.imagePullSecrets }} imagePullSecrets: - name: {{ .Values.deployment.imagePullSecrets }} diff --git a/application/values.yaml b/application/values.yaml index fee4723f..9c559e38 100644 --- a/application/values.yaml +++ b/application/values.yaml @@ -166,6 +166,27 @@ deployment: # values: # - ssd + # Topology spread constraints + topologySpreadConstraints: + # - maxSkew: 1 + # topologyKey: kubernetes.io/hostname + # whenUnsatisfiable: ScheduleAnyway + # labelSelector: + # matchExpressions: + # - key: disktype + # operator: In + # values: + # - ssd + # - maxSkew: 1 + # topologyKey: topology.kubernetes.io/zone + # whenUnsatisfiable: ScheduleAnyway + # labelSelector: + # matchExpressions: + # - key: disktype + # operator: In + # values: + # - ssd + # Image of the app container image: repository: repository/image-name