Skip to content

Commit 5cdb53d

Browse files
committed
UPSTREAM: <carry>: add scheduling preference/priorityClass annotations
Signed-off-by: Jordan Keister <[email protected]>
1 parent 627cafd commit 5cdb53d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

openshift/generate-manifests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ $KUSTOMIZE build "${TMP_CONFIG}/default" -o "$TMP_KUSTOMIZE_OUTPUT"
5555
for container_name in "${!IMAGE_MAPPINGS[@]}"; do
5656
placeholder="${IMAGE_MAPPINGS[$container_name]}"
5757
$YQ -i "(select(.kind == \"Deployment\")|.spec.template.spec.containers[]|select(.name==\"$container_name\")|.image) = \"$placeholder\"" "$TMP_KUSTOMIZE_OUTPUT"
58+
$YQ -i 'select(.kind == "Deployment").metadata.annotations += {"target.workload.openshift.io/management": "{\"effect\": \"PreferredDuringScheduling\"}"}' "$TMP_KUSTOMIZE_OUTPUT"
59+
$YQ -i 'select(.kind == "Deployment").spec.template.spec += {"priorityClassName": "system-cluster-critical"}' "$TMP_KUSTOMIZE_OUTPUT"
5860
done
5961

6062
# Use yq to split the single yaml file into 1 per document.

openshift/manifests/11-deployment-openshift-operator-controller-operator-controller-controller-manager.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ kind: Deployment
44
metadata:
55
annotations:
66
kubectl.kubernetes.io/default-logs-container: manager
7+
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
78
labels:
89
app.kubernetes.io/component: manager
910
app.kubernetes.io/created-by: operator-controller
@@ -105,3 +106,4 @@ spec:
105106
type: RuntimeDefault
106107
serviceAccountName: operator-controller-controller-manager
107108
terminationGracePeriodSeconds: 10
109+
priorityClassName: system-cluster-critical

0 commit comments

Comments
 (0)