Skip to content

Commit

Permalink
Add priorityclass system-cluster-critical to operator
Browse files Browse the repository at this point in the history
Ensure this component has precedence over user deployed workload.
  • Loading branch information
DebakelOrakel committed Apr 17, 2024
1 parent 5934e0d commit 895bcf6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ parameters:
enableMonitoring: ${patch_operator:monitoring_enabled}

monitoring_enabled: true
priority_class: system-cluster-critical

alerts:
PatchReconcileSlow:
Expand Down
3 changes: 3 additions & 0 deletions class/patch-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ parameters:
- type: jsonnet
filter: postprocess/fixup-helm-chart.jsonnet
path: patch-operator/01_helm_chart/patch-operator/templates
- type: jsonnet
filter: postprocess/add-priorityclass.jsonnet
path: patch-operator/01_helm_chart/patch-operator/templates
20 changes: 20 additions & 0 deletions postprocess/add-priorityclass.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local com = import 'lib/commodore.libjsonnet';
local inv = com.inventory();
// The hiera parameters for the component
local params = inv.parameters.patch_operator;

local priotityclassPatch = {
spec+: {
template+: {
spec+: {
priorityClassName: params.priority_class,
},
},
},
};

local deployFile = com.yaml_load(std.extVar('output_path') + '/' + 'manager.yaml');

{
manager: deployFile + priotityclassPatch,
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: webhook-server-cert
readOnly: true
priorityClassName: system-cluster-critical
serviceAccountName: controller-manager
volumes:
- name: patch-operator-certs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: webhook-server-cert
readOnly: true
priorityClassName: system-cluster-critical
serviceAccountName: controller-manager
volumes:
- name: patch-operator-certs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: webhook-server-cert
readOnly: true
priorityClassName: system-cluster-critical
serviceAccountName: controller-manager
volumes:
- name: patch-operator-certs
Expand Down

0 comments on commit 895bcf6

Please sign in to comment.