Enable {priority,runtime}ClassName for Barbican

Change-Id: Ic8682751f7876c98a078bf4bc5ddb1e10aa3bbf3
This commit is contained in:
Dong Ma committed 2025-02-10 07:17:49 +00:00
1 parent 8ccabb61cb
commit 1da7ecac89
7 files changed
+183

No files matched your search

@@ -47,6 +47,12 @@ spec:
{{ dict "envAll" $envAll "podName" "barbican-api" "containerNames" (list "init" "barbican-api") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
{{ dict "envAll" $envAll "application" "barbican" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
{{ with .Values.pod.priorityClassName.barbican_api }}
priorityClassName: {{ . }}
{{ end }}
{{ with .Values.pod.runtimeClassName.barbican_api }}
runtimeClassName: {{ . }}
{{ end }}
serviceAccountName: {{ $serviceAccountName }}
affinity:
{{ tuple $envAll "barbican" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
+6
View File
@@ -33,6 +33,12 @@ metadata:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
{{ dict "envAll" $envAll "podName" "barbican-test" "containerNames" (list "init" "barbican-test") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 4 }}
spec:
{{ with .Values.pod.priorityClassName.barbican_tests }}
priorityClassName: {{ . }}
{{ end }}
{{ with .Values.pod.runtimeClassName.barbican_tests }}
runtimeClassName: {{ . }}
{{ end }}
serviceAccountName: {{ $serviceAccountName }}
{{ dict "envAll" $envAll "application" "test" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 2 }}
nodeSelector:
+8
View File
@@ -55,6 +55,14 @@ images:
- image_repo_sync
pod:
priorityClassName:
barbican_api: null
barbican_tests: null
db_sync: null
runtimeClassName:
barbican_api: null
barbican_tests: null
db_sync: null
security_context:
barbican:
pod:
@@ -0,0 +1,63 @@
From e7640e5fc0179fabfa063e89f7e7a7612e1c807e Mon Sep 17 00:00:00 2001
From: Dong Ma <dong.ma@vexxhost.com>
Date: Mon, 10 Feb 2025 06:32:12 +0000
Subject: [PATCH] Enable {priority,runtime}ClassName for Barbican
---
barbican/templates/deployment-api.yaml | 6 +++
barbican/templates/pod-test.yaml | 6 +++
barbican/values.yaml | 8 ++++
diff --git a/barbican/templates/deployment-api.yaml b/barbican/templates/deployment-api.yaml
index 8ae9ea42..1e5cbbac 100644
--- a/barbican/templates/deployment-api.yaml
+++ b/barbican/templates/deployment-api.yaml
@@ -47,6 +47,12 @@ spec:
{{ dict "envAll" $envAll "podName" "barbican-api" "containerNames" (list "init" "barbican-api") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
{{ dict "envAll" $envAll "application" "barbican" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
+{{ with .Values.pod.priorityClassName.barbican_api }}
+ priorityClassName: {{ . }}
+{{ end }}
+{{ with .Values.pod.runtimeClassName.barbican_api }}
+ runtimeClassName: {{ . }}
+{{ end }}
serviceAccountName: {{ $serviceAccountName }}
affinity:
{{ tuple $envAll "barbican" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
diff --git a/barbican/templates/pod-test.yaml b/barbican/templates/pod-test.yaml
index f4143564..783d328b 100644
--- a/barbican/templates/pod-test.yaml
+++ b/barbican/templates/pod-test.yaml
@@ -33,6 +33,12 @@ metadata:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
{{ dict "envAll" $envAll "podName" "barbican-test" "containerNames" (list "init" "barbican-test") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 4 }}
spec:
+{{ with .Values.pod.priorityClassName.barbican_tests }}
+ priorityClassName: {{ . }}
+{{ end }}
+{{ with .Values.pod.runtimeClassName.barbican_tests }}
+ runtimeClassName: {{ . }}
+{{ end }}
serviceAccountName: {{ $serviceAccountName }}
{{ dict "envAll" $envAll "application" "test" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 2 }}
nodeSelector:
diff --git a/barbican/values.yaml b/barbican/values.yaml
index e2e87bf7..17aee723 100644
--- a/barbican/values.yaml
+++ b/barbican/values.yaml
@@ -55,6 +55,14 @@ images:
- image_repo_sync
pod:
+ priorityClassName:
+ barbican_api: null
+ barbican_tests: null
+ db_sync: null
+ runtimeClassName:
+ barbican_api: null
+ barbican_tests: null
+ db_sync: null
security_context:
barbican:
pod:
@@ -0,0 +1,4 @@
---
features:
- The Barbican role now allows users to configure the ``priorityClassName`` and
the ``runtimeClassName`` for all of the different components of the service.
@@ -0,0 +1,48 @@
suite: priorityclass
tests:
- it: should support not having a priority class
templates:
- templates/deployment-api.yaml
- templates/pod-test.yaml
- templates/job-db-sync.yaml
asserts:
- template: templates/deployment-api.yaml
documentIndex: 3
notExists:
path: spec.template.spec.priorityClassName
- template: templates/pod-test.yaml
documentIndex: 1
notExists:
path: spec.priorityClassName
- template: templates/job-db-sync.yaml
documentIndex: 3
notExists:
path: spec.template.spec.priorityClassName
- it: should support setting a priority class
templates:
- templates/deployment-api.yaml
- templates/pod-test.yaml
- templates/job-db-sync.yaml
set:
pod:
priorityClassName:
barbican_api: platform
barbican_tests: platform
db_sync: platform
asserts:
- template: templates/deployment-api.yaml
documentIndex: 3
equal:
path: spec.template.spec.priorityClassName
value: platform
- template: templates/pod-test.yaml
documentIndex: 1
equal:
path: spec.priorityClassName
value: platform
- template: templates/job-db-sync.yaml
documentIndex: 3
equal:
path: spec.template.spec.priorityClassName
value: platform
@@ -0,0 +1,48 @@
suite: runtimeclass
tests:
- it: should support not having a runtime class
templates:
- templates/deployment-api.yaml
- templates/pod-test.yaml
- templates/job-db-sync.yaml
asserts:
- template: templates/deployment-api.yaml
documentIndex: 3
notExists:
path: spec.template.spec.runtimeClassName
- template: templates/pod-test.yaml
documentIndex: 1
notExists:
path: spec.runtimeClassName
- template: templates/job-db-sync.yaml
documentIndex: 3
notExists:
path: spec.template.spec.runtimeClassName
- it: should support setting a runtime class
templates:
- templates/deployment-api.yaml
- templates/pod-rally-test.yaml
- templates/job-db-sync.yaml
set:
pod:
runtimeClassName:
barbican_api: kata-clh
barbican_tests: kata-clh
db_sync: kata-clh
asserts:
- template: templates/deployment-api.yaml
documentIndex: 3
equal:
path: spec.template.spec.runtimeClassName
value: kata-clh
- template: templates/pod-test.yaml
documentIndex: 1
equal:
path: spec.runtimeClassName
value: kata-clh
- template: templates/job-db-sync.yaml
documentIndex: 3
equal:
path: spec.template.spec.runtimeClassName
value: kata-clh