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

eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 14341ff6ea feat(helm): add support for priorityClassName on Redis pods 
(#34879)
14341ff6ea is described below

commit 14341ff6ea176f2325ebfd3f9b734a3635078cf4
Author: Jim Ntosas <[email protected]>
AuthorDate: Sat Oct 28 10:51:42 2023 +0300

    feat(helm): add support for priorityClassName on Redis pods (#34879)
    
    * feat(helm): add support for priorityClassName on Redis pods
    
    ---------
    
    Signed-off-by: dntosas <[email protected]>
    Co-authored-by: Elad Kalif <[email protected]>
---
 chart/templates/redis/redis-statefulset.yaml |  3 +++
 chart/values.schema.json                     |  8 ++++++++
 chart/values.yaml                            |  1 +
 helm_tests/other/test_redis.py               | 11 +++++++++++
 4 files changed, 23 insertions(+)

diff --git a/chart/templates/redis/redis-statefulset.yaml 
b/chart/templates/redis/redis-statefulset.yaml
index 62220a7ca5..b978373b94 100644
--- a/chart/templates/redis/redis-statefulset.yaml
+++ b/chart/templates/redis/redis-statefulset.yaml
@@ -67,6 +67,9 @@ spec:
         {{- end }}
       {{- end }}
     spec:
+      {{- if .Values.redis.priorityClassName }}
+      priorityClassName: {{ .Values.redis.priorityClassName }}
+      {{- end }}
       nodeSelector: {{- toYaml $nodeSelector | nindent 8 }}
       affinity: {{- toYaml $affinity | nindent 8 }}
       tolerations: {{- toYaml $tolerations | nindent 8 }}
diff --git a/chart/values.schema.json b/chart/values.schema.json
index a1a93a51b3..711cbf1a16 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -6241,6 +6241,14 @@
                         "$ref": 
"#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint"
                     }
                 },
+                "priorityClassName": {
+                    "description": "Specify priority for redis pods.",
+                    "type": [
+                        "string",
+                        "null"
+                    ],
+                    "default": null
+                },
                 "serviceAccount": {
                     "description": "Create ServiceAccount.",
                     "type": "object",
diff --git a/chart/values.yaml b/chart/values.yaml
index e735800f9d..859f25e020 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -2096,6 +2096,7 @@ redis:
   affinity: {}
   tolerations: []
   topologySpreadConstraints: []
+  priorityClassName: ~
 
   # Set to 0 for backwards-compatiblity
   uid: 0
diff --git a/helm_tests/other/test_redis.py b/helm_tests/other/test_redis.py
index 6711118da2..cdbb5e2d5a 100644
--- a/helm_tests/other/test_redis.py
+++ b/helm_tests/other/test_redis.py
@@ -357,6 +357,17 @@ class TestRedis:
         )
         assert {"name": "redis-db", **expected} in 
jmespath.search("spec.template.spec.volumes", docs[0])
 
+    def test_priority_class_name(self):
+        docs = render_chart(
+            values={"redis": {"priorityClassName": 
"airflow-priority-class-name"}},
+            show_only=["templates/redis/redis-statefulset.yaml"],
+        )
+
+        assert "airflow-priority-class-name" == jmespath.search(
+            "spec.template.spec.priorityClassName",
+            docs[0],
+        )
+
 
 class TestRedisServiceAccount:
     """Tests redis service account."""

Reply via email to