diff --git a/component/blackbox-exporter.libsonnet b/component/blackbox-exporter.libsonnet index a4c17b5..053a558 100644 --- a/component/blackbox-exporter.libsonnet +++ b/component/blackbox-exporter.libsonnet @@ -126,6 +126,7 @@ local deploy = com.namespaced( }, }, ], + priorityClassName: 'system-cluster-critical', restartPolicy: 'Always', securityContext: {}, serviceAccountName: sa.metadata.name, diff --git a/component/network-canary.libsonnet b/component/network-canary.libsonnet index fbf658d..ad2a5f1 100644 --- a/component/network-canary.libsonnet +++ b/component/network-canary.libsonnet @@ -60,6 +60,7 @@ local ds = kube.DaemonSet('network-canary') { value: '0 2147483647', } ], }, + priorityClassName: 'system-node-critical', tolerations: std.objectValues(params.network_canary.tolerations), }, }, diff --git a/component/scheduler-canary.jsonnet b/component/scheduler-canary.jsonnet index 68f60c6..846398e 100644 --- a/component/scheduler-canary.jsonnet +++ b/component/scheduler-canary.jsonnet @@ -10,6 +10,18 @@ local inv = kap.inventory(); local params = inv.parameters.openshift4_slos; +local setPriorityClass = { + patch: ||| + - op: add + path: "/spec/template/spec/priorityClassName" + value: "system-cluster-critical" + |||, + target: { + kind: 'Deployment', + name: 'scheduler-canary-controller-manager', + }, +}; + local kustomization = if params.canary_scheduler_controller.enabled then local image = params.images.canary_scheduler_controller; @@ -22,7 +34,11 @@ local kustomization = newName: '%(registry)s/%(image)s' % image, }, }, - params.canary_scheduler_controller.kustomize_input, + params.canary_scheduler_controller.kustomize_input { + patches+: [ + setPriorityClass, + ], + }, ) else { kustomization: { resources: [] }, diff --git a/tests/golden/defaults/openshift4-slos/openshift4-slos/20_blackbox_exporter_deploy.yaml b/tests/golden/defaults/openshift4-slos/openshift4-slos/20_blackbox_exporter_deploy.yaml index 8b4bdb6..86db095 100644 --- a/tests/golden/defaults/openshift4-slos/openshift4-slos/20_blackbox_exporter_deploy.yaml +++ b/tests/golden/defaults/openshift4-slos/openshift4-slos/20_blackbox_exporter_deploy.yaml @@ -84,6 +84,7 @@ spec: name: config imagePullSecrets: [] initContainers: [] + priorityClassName: system-cluster-critical restartPolicy: Always securityContext: {} serviceAccountName: prometheus-blackbox-exporter diff --git a/tests/golden/defaults/openshift4-slos/openshift4-slos/20_network_canary_daemonset.yaml b/tests/golden/defaults/openshift4-slos/openshift4-slos/20_network_canary_daemonset.yaml index 2623914..5d539af 100644 --- a/tests/golden/defaults/openshift4-slos/openshift4-slos/20_network_canary_daemonset.yaml +++ b/tests/golden/defaults/openshift4-slos/openshift4-slos/20_network_canary_daemonset.yaml @@ -42,6 +42,7 @@ spec: volumeMounts: [] imagePullSecrets: [] initContainers: [] + priorityClassName: system-node-critical terminationGracePeriodSeconds: 30 tolerations: - effect: NoSchedule diff --git a/tests/golden/defaults/openshift4-slos/openshift4-slos/scheduler-canary-deployment/apps_v1_deployment_scheduler-canary-controller-manager.yaml b/tests/golden/defaults/openshift4-slos/openshift4-slos/scheduler-canary-deployment/apps_v1_deployment_scheduler-canary-controller-manager.yaml index f847f3e..aafdd30 100644 --- a/tests/golden/defaults/openshift4-slos/openshift4-slos/scheduler-canary-deployment/apps_v1_deployment_scheduler-canary-controller-manager.yaml +++ b/tests/golden/defaults/openshift4-slos/openshift4-slos/scheduler-canary-deployment/apps_v1_deployment_scheduler-canary-controller-manager.yaml @@ -81,6 +81,7 @@ spec: capabilities: drop: - ALL + priorityClassName: system-cluster-critical securityContext: runAsNonRoot: true serviceAccountName: scheduler-canary-controller-manager diff --git a/tests/golden/network-only/openshift4-slos/openshift4-slos/20_network_canary_daemonset.yaml b/tests/golden/network-only/openshift4-slos/openshift4-slos/20_network_canary_daemonset.yaml index 652da13..9fc83b0 100644 --- a/tests/golden/network-only/openshift4-slos/openshift4-slos/20_network_canary_daemonset.yaml +++ b/tests/golden/network-only/openshift4-slos/openshift4-slos/20_network_canary_daemonset.yaml @@ -44,6 +44,7 @@ spec: initContainers: [] nodeSelector: node-role.kubernetes.io/worker: 'true' + priorityClassName: system-node-critical securityContext: sysctls: - name: net.ipv4.ping_group_range