-
Notifications
You must be signed in to change notification settings - Fork 10
/
aap-2.4.sh
executable file
·30 lines (26 loc) · 2.77 KB
/
aap-2.4.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Ansible Automation Platform ZTP day2 tuning
aap_csv=$(oc get csv -n ansible-automation-platform -l operators.coreos.com/ansible-automation-platform-operator.ansible-automation-platfor= -o json | jq '.items[0].metadata.name' -r)
echo "Using AAP csv: ${aap_csv}"
echo "Patching AAP resource-operator-controller-manager's platform-resource-manager memory limit to 32Gi"
oc get csv -n ansible-automation-platform ${aap_csv} -o json | jq '.spec.install.spec.deployments[] | select(.name=="resource-operator-controller-manager").spec.template.spec.containers[] | select(.name=="platform-resource-manager").resources.limits.memory'
oc get deploy -n ansible-automation-platform resource-operator-controller-manager -o json | jq '.spec.template.spec.containers[] | select(.name=="platform-resource-manager").resources.limits.memory'
oc get csv -n ansible-automation-platform ${aap_csv} -o json | jq '.spec.install.spec.deployments[] |= (select(.name=="resource-operator-controller-manager").spec.template.spec.containers[] |= (select(.name=="platform-resource-manager").resources.limits.memory = "32Gi"))' | oc replace -f -
oc get csv -n ansible-automation-platform ${aap_csv} -o json | jq '.spec.install.spec.deployments[] | select(.name=="resource-operator-controller-manager").spec.template.spec.containers[] | select(.name=="platform-resource-manager").resources.limits.memory'
oc get deploy -n ansible-automation-platform resource-operator-controller-manager -o json | jq '.spec.template.spec.containers[] | select(.name=="platform-resource-manager").resources.limits.memory'
echo "Sleep 10"
sleep 10
# Possibly this belongs in ACM tuning instead of AAP, but is needed when AAP is enabled
# Tune multicluster-operators-hub-subscription for large scale interaction with AAP
# https://issues.redhat.com/browse/ACM-8636
echo "Applying ACM multicluster-operators-hub-subscription memory limit bump to 32Gi"
oc annotate mch -n open-cluster-management multiclusterhub mch-pause=True
# It seems it is possible to apply a patch too quickly after pausing the mch, pause for 20s
echo "Sleep 20"
sleep 20
oc get deploy -n open-cluster-management multicluster-operators-hub-subscription -o json | jq '.spec.template.spec.containers[] | select(.name=="multicluster-operators-hub-subscription") | .resources.limits.memory'
oc get deploy -n open-cluster-management multicluster-operators-hub-subscription -o json | jq '.spec.template.spec.containers[] |= (select(.name=="multicluster-operators-hub-subscription").resources.limits.memory = "32Gi")' | oc replace -f -
oc get deploy -n open-cluster-management multicluster-operators-hub-subscription -o json | jq '.spec.template.spec.containers[] | select(.name=="multicluster-operators-hub-subscription") | .resources.limits.memory'
echo "Sleep 10"
sleep 10
echo "Done Patching"