From 01a0e97fa181a0e090b4cf660e2727cbacada1b5 Mon Sep 17 00:00:00 2001 From: Filip Haftek Date: Wed, 20 Nov 2024 11:38:51 +0100 Subject: [PATCH] sourcegraph: add priority class support to redis deployment (#581) ref: CLO-1017 ### Checklist - [x] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md) - [x] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md) - [ ] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes) (no change) ### Test plan Unit tests. --- charts/sourcegraph/CHANGELOG.md | 1 + .../redis/redis-cache.Deployment.yaml | 3 +++ .../redis/redis-store.Deployment.yaml | 3 +++ .../sourcegraph/tests/priorityClass_test.yaml | 20 ++++++++++++++++++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/charts/sourcegraph/CHANGELOG.md b/charts/sourcegraph/CHANGELOG.md index 4de9641a..d28846ec 100644 --- a/charts/sourcegraph/CHANGELOG.md +++ b/charts/sourcegraph/CHANGELOG.md @@ -9,6 +9,7 @@ Use `**BREAKING**:` to denote a breaking change ## Unreleased - Updated OpenTelemetry collector and agent images to run as non-root users [#543](https://github.com/sourcegraph/deploy-sourcegraph-helm/pull/543) +- redis cache and redis store deployments support priority class ## 5.6.185 diff --git a/charts/sourcegraph/templates/redis/redis-cache.Deployment.yaml b/charts/sourcegraph/templates/redis/redis-cache.Deployment.yaml index a5d08dae..da11dbcd 100644 --- a/charts/sourcegraph/templates/redis/redis-cache.Deployment.yaml +++ b/charts/sourcegraph/templates/redis/redis-cache.Deployment.yaml @@ -131,6 +131,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- include "sourcegraph.renderServiceAccountName" (list . "redisCache") | trim | nindent 6 }} + {{- if .Values.redisCache.priorityClassName }} + priorityClassName: {{ .Values.redisCache.priorityClassName }} + {{- end }} volumes: - name: redis-data persistentVolumeClaim: diff --git a/charts/sourcegraph/templates/redis/redis-store.Deployment.yaml b/charts/sourcegraph/templates/redis/redis-store.Deployment.yaml index 125e027e..f9ff22a7 100644 --- a/charts/sourcegraph/templates/redis/redis-store.Deployment.yaml +++ b/charts/sourcegraph/templates/redis/redis-store.Deployment.yaml @@ -130,6 +130,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- include "sourcegraph.renderServiceAccountName" (list . "redisStore") | trim | nindent 6 }} + {{- if .Values.redisStore.priorityClassName }} + priorityClassName: {{ .Values.redisStore.priorityClassName }} + {{- end }} volumes: - name: redis-data persistentVolumeClaim: diff --git a/charts/sourcegraph/tests/priorityClass_test.yaml b/charts/sourcegraph/tests/priorityClass_test.yaml index d57f3ebd..16a45540 100644 --- a/charts/sourcegraph/tests/priorityClass_test.yaml +++ b/charts/sourcegraph/tests/priorityClass_test.yaml @@ -104,4 +104,22 @@ tests: asserts: - equal: path: spec.template.spec.priorityClassName - value: symbols-class \ No newline at end of file + value: symbols-class +- it: set priority class on redisCache + template: redis/redis-cache.Deployment.yaml + set: + redisCache: + priorityClassName: redis-cache-class + asserts: + - equal: + path: spec.template.spec.priorityClassName + value: redis-cache-class +- it: set priority class on redisStore + template: redis/redis-store.Deployment.yaml + set: + redisStore: + priorityClassName: redis-store-class + asserts: + - equal: + path: spec.template.spec.priorityClassName + value: redis-store-class