This is an automated email from the ASF dual-hosted git repository.

alinsran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-helm-chart.git


The following commit(s) were added to refs/heads/master by this push:
     new af32767  fix: revert Topology Spread Constraints to apisix (#760)
af32767 is described below

commit af3276779f115a92590d44319292833d1d2acacc
Author: Juan Enciso <juan.enc...@gmail.com>
AuthorDate: Fri Jun 7 04:09:00 2024 +0100

    fix: revert Topology Spread Constraints to apisix (#760)
---
 charts/apisix/README.md                 | 1 +
 charts/apisix/templates/deployment.yaml | 4 ++++
 charts/apisix/values.yaml               | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/charts/apisix/README.md b/charts/apisix/README.md
index 0d17866..06b7e03 100644
--- a/charts/apisix/README.md
+++ b/charts/apisix/README.md
@@ -211,5 +211,6 @@ The command removes all the Kubernetes components 
associated with the chart and
 | serviceAccount.name | string | `""` |  |
 | timezone | string | `""` | timezone is the timezone where apisix uses. For 
example: "UTC" or "Asia/Shanghai" This value will be set on apisix container's 
environment variable TZ. You may need to set the timezone to be consistent with 
your local time zone, otherwise the apisix's logs may used to retrieve event 
maybe in wrong timezone. |
 | tolerations | list | `[]` | List of node taints to tolerate |
+| topologySpreadConstraints | list | `[]` | Topology Spread Constraints for 
pod assignment spread across your cluster among failure-domains ref: 
https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods
 |
 | updateStrategy | object | `{}` |  |
 | useDaemonSet | bool | `false` | set false to use `Deployment`, set true to 
use `DaemonSet` |
diff --git a/charts/apisix/templates/deployment.yaml 
b/charts/apisix/templates/deployment.yaml
index 07734c3..884e3b5 100644
--- a/charts/apisix/templates/deployment.yaml
+++ b/charts/apisix/templates/deployment.yaml
@@ -290,3 +290,7 @@ spec:
       tolerations:
         {{- toYaml . | nindent 8 }}
       {{- end }}
+      {{- with .Values.topologySpreadConstraints }}
+      topologySpreadConstraints:
+        {{- tpl (. | toYaml) $ | nindent 8 }}
+      {{- end }}
diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml
index 1b5241e..ffe0458 100644
--- a/charts/apisix/values.yaml
+++ b/charts/apisix/values.yaml
@@ -85,6 +85,9 @@ nodeSelector: {}
 tolerations: []
 # -- Set affinity for Apache APISIX deploy
 affinity: {}
+# -- Topology Spread Constraints for pod assignment spread across your cluster 
among failure-domains
+# ref: 
https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods
+topologySpreadConstraints: []
 
 # -- timezone is the timezone where apisix uses.
 # For example: "UTC" or "Asia/Shanghai"

Reply via email to