Skip to content

Commit 733d923

Browse files
Merge pull request #20 from grokspawn/annotations-add
UPSTREAM: <carry>: add scheduling preference/priorityClass annotations
2 parents 627cafd + dd377e1 commit 733d923

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").spec.template.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
@@ -23,6 +23,7 @@ spec:
2323
metadata:
2424
annotations:
2525
kubectl.kubernetes.io/default-container: manager
26+
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
2627
labels:
2728
control-plane: controller-manager
2829
spec:
@@ -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)