diff --git a/.changes/unreleased/Feature-20250602-122014.yaml b/.changes/unreleased/Feature-20250602-122014.yaml new file mode 100644 index 0000000..2939074 --- /dev/null +++ b/.changes/unreleased/Feature-20250602-122014.yaml @@ -0,0 +1,3 @@ +kind: Feature +body: Make priority classes configurable in self-hosted opslevel +time: 2025-06-02T12:20:14.939124-05:00 diff --git a/charts/opslevel/templates/elasticsearch/statefulset.yaml b/charts/opslevel/templates/elasticsearch/statefulset.yaml index 91a6c1c..3ceba28 100644 --- a/charts/opslevel/templates/elasticsearch/statefulset.yaml +++ b/charts/opslevel/templates/elasticsearch/statefulset.yaml @@ -27,7 +27,7 @@ spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} serviceAccountName: "{{ .Values.elasticsearch.serviceAccount.name }}" - priorityClassName: opslevel-high + priorityClassName: {{ .Values.priorityClasses.high }} {{- with .Values.elasticsearch.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/faktory/statefulset.yaml b/charts/opslevel/templates/faktory/statefulset.yaml index e6df622..679d56e 100644 --- a/charts/opslevel/templates/faktory/statefulset.yaml +++ b/charts/opslevel/templates/faktory/statefulset.yaml @@ -30,7 +30,7 @@ spec: {{- template "global.nodeSelector" . }} terminationGracePeriodSeconds: 10 shareProcessNamespace: true - priorityClassName: opslevel-critical + priorityClassName: {{ .Values.priorityClasses.critical }} {{- with .Values.faktory.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/minio/statefulset.yaml b/charts/opslevel/templates/minio/statefulset.yaml index 7bb65c3..c3dae3f 100644 --- a/charts/opslevel/templates/minio/statefulset.yaml +++ b/charts/opslevel/templates/minio/statefulset.yaml @@ -26,7 +26,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-high + priorityClassName: {{ .Values.priorityClasses.high }} {{- with .Values.objectStorage.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/mysql/statefulset.yaml b/charts/opslevel/templates/mysql/statefulset.yaml index 0ac4f74..16a4a4b 100644 --- a/charts/opslevel/templates/mysql/statefulset.yaml +++ b/charts/opslevel/templates/mysql/statefulset.yaml @@ -31,7 +31,7 @@ spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} serviceAccountName: "{{ .Values.mysql.serviceAccount.name }}" - priorityClassName: opslevel-critical + priorityClassName: {{ .Values.priorityClasses.critical }} {{- with .Values.mysql.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/opslevel/scheduler.yaml b/charts/opslevel/templates/opslevel/scheduler.yaml index 7e492a9..e5c23ae 100644 --- a/charts/opslevel/templates/opslevel/scheduler.yaml +++ b/charts/opslevel/templates/opslevel/scheduler.yaml @@ -31,7 +31,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} terminationGracePeriodSeconds: 300 initContainers: {{- if .Values.certificate.enabled }} diff --git a/charts/opslevel/templates/opslevel/web.yaml b/charts/opslevel/templates/opslevel/web.yaml index a1ec385..0c01a79 100644 --- a/charts/opslevel/templates/opslevel/web.yaml +++ b/charts/opslevel/templates/opslevel/web.yaml @@ -31,7 +31,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.opslevel.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/opslevel/worker-faktory.yaml b/charts/opslevel/templates/opslevel/worker-faktory.yaml index 481a611..bfa268c 100644 --- a/charts/opslevel/templates/opslevel/worker-faktory.yaml +++ b/charts/opslevel/templates/opslevel/worker-faktory.yaml @@ -31,7 +31,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.opslevel.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/opslevel/worker-high.yaml b/charts/opslevel/templates/opslevel/worker-high.yaml index 4d83a2b..40f25c2 100644 --- a/charts/opslevel/templates/opslevel/worker-high.yaml +++ b/charts/opslevel/templates/opslevel/worker-high.yaml @@ -31,7 +31,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.opslevel.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/opslevel/worker-low.yaml b/charts/opslevel/templates/opslevel/worker-low.yaml index 55b13a3..4880d41 100644 --- a/charts/opslevel/templates/opslevel/worker-low.yaml +++ b/charts/opslevel/templates/opslevel/worker-low.yaml @@ -31,7 +31,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.opslevel.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/opslevel/worker-search.yaml b/charts/opslevel/templates/opslevel/worker-search.yaml index e81f801..ef4e116 100644 --- a/charts/opslevel/templates/opslevel/worker-search.yaml +++ b/charts/opslevel/templates/opslevel/worker-search.yaml @@ -31,7 +31,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.opslevel.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/opssight/web.yaml b/charts/opslevel/templates/opssight/web.yaml index bed4acc..8485347 100644 --- a/charts/opslevel/templates/opssight/web.yaml +++ b/charts/opslevel/templates/opssight/web.yaml @@ -32,7 +32,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.opssight.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/opssight/worker.yaml b/charts/opslevel/templates/opssight/worker.yaml index 7e58b50..9f87e01 100644 --- a/charts/opslevel/templates/opssight/worker.yaml +++ b/charts/opslevel/templates/opssight/worker.yaml @@ -28,7 +28,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.opssight.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/postgres/statefulset.yaml b/charts/opslevel/templates/postgres/statefulset.yaml index 4c3d4e1..38c697d 100644 --- a/charts/opslevel/templates/postgres/statefulset.yaml +++ b/charts/opslevel/templates/postgres/statefulset.yaml @@ -31,7 +31,7 @@ spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} serviceAccountName: "{{ .Values.postgres.serviceAccount.name }}" - priorityClassName: opslevel-high + priorityClassName: {{ .Values.priorityClasses.high }} {{- with .Values.postgres.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/priority-class.yaml b/charts/opslevel/templates/priority-class.yaml index bd55ccc..40025e1 100644 --- a/charts/opslevel/templates/priority-class.yaml +++ b/charts/opslevel/templates/priority-class.yaml @@ -1,7 +1,8 @@ +{{- if eq .Values.priorityClasses.create true }} apiVersion: scheduling.k8s.io/v1 kind: PriorityClass metadata: - name: opslevel-critical + name: {{ .Values.priorityClasses.critical }} value: 1000000 globalDefault: false description: "This priority class will be used to ensure opslevel mysql pod preempts other self-hosted workloads." @@ -9,7 +10,7 @@ description: "This priority class will be used to ensure opslevel mysql pod pree apiVersion: scheduling.k8s.io/v1 kind: PriorityClass metadata: - name: opslevel-high + name: {{ .Values.priorityClasses.high }} value: 10000 globalDefault: false description: "This priority class will be used for statefulsets to ensure they preempts other self-hosted workloads." @@ -17,7 +18,8 @@ description: "This priority class will be used for statefulsets to ensure they p apiVersion: scheduling.k8s.io/v1 kind: PriorityClass metadata: - name: opslevel-normal + name: {{ .Values.priorityClasses.normal }} value: 100 globalDefault: false description: "This priority class will be used for all other self-hosted workloads." +{{- end }} diff --git a/charts/opslevel/templates/redis/deployment.yaml b/charts/opslevel/templates/redis/deployment.yaml index f649ac7..0231480 100644 --- a/charts/opslevel/templates/redis/deployment.yaml +++ b/charts/opslevel/templates/redis/deployment.yaml @@ -28,7 +28,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.redis.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/runner/new-mode.yaml b/charts/opslevel/templates/runner/new-mode.yaml index 4fd37de..6d0388b 100644 --- a/charts/opslevel/templates/runner/new-mode.yaml +++ b/charts/opslevel/templates/runner/new-mode.yaml @@ -30,7 +30,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.runner.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/templates/runner/old-mode.yaml b/charts/opslevel/templates/runner/old-mode.yaml index df6dfe8..36e9d2b 100644 --- a/charts/opslevel/templates/runner/old-mode.yaml +++ b/charts/opslevel/templates/runner/old-mode.yaml @@ -30,7 +30,7 @@ spec: spec: {{- template "opslevel.pullSecrets" . }} {{- template "global.nodeSelector" . }} - priorityClassName: opslevel-normal + priorityClassName: {{ .Values.priorityClasses.normal }} {{- with .Values.runner.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/opslevel/values.yaml b/charts/opslevel/values.yaml index 6afdafd..926c752 100644 --- a/charts/opslevel/values.yaml +++ b/charts/opslevel/values.yaml @@ -338,3 +338,8 @@ certificate: crt: "" key: "" +priorityClasses: + create: true + critical: "opslevel-critical" + high: "opslevel-high" + normal: "opslevel-normal" \ No newline at end of file