-
Notifications
You must be signed in to change notification settings - Fork 134
/
deploy.sh
executable file
·64 lines (52 loc) · 1.66 KB
/
deploy.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
set -euo pipefail
source $(dirname "$0")/../hack/common.sh
# Check if there is at least one worker-rt node
RTNODES=$(oc get node --selector=node-role.kubernetes.io/worker-rt="")
if [ "${RTNODES}" == "" ] ; then
echo "No node with worker-rt label found"
exit 1
fi
# W/A for https://bugzilla.redhat.com/show_bug.cgi?id=1777150
# Apply 'worker=""' label only if not set already.
until oc label --overwrite machineconfigpool/worker worker=; do
sleep 5
done
# pause all machine config pools
until mcps=$(oc get machineconfigpool --no-headers -o name); do
sleep 5
done
for mcp in ${mcps}; do
until oc patch --type=merge --patch='{"spec":{"paused":true}}' ${mcp}; do
sleep 5
done
done
# apply performance manifests
until oc apply -R -f ${PERFORMANCE_MANIFESTS_GENERATED_DIR}; do
sleep 5
done
# unpause all machine config pools
for mcp in ${mcps}; do
until oc patch --type=merge --patch='{"spec":{"paused":false}}' ${mcp}; do
sleep 5
done
done
# wait for the configuration update
# NOTE: be sure that you have node with the worker-rt role, otherwise it will stuck for a long time
# NOTE: we are waiting only for worker-rt machineconfigpool,
# but all other machineconfigpools will also run the update, because of the feature gate update
timeout=1800
count=0
until oc wait machineconfigpools worker-rt --for condition=Updating --timeout=60s; do
count=$((count + 60))
if [[ ${count} -ge ${timeout} ]]; then
break
fi
done
count=0
until oc wait machineconfigpools worker-rt --for condition=Updated --timeout=60s; do
count=$((count + 60))
if [[ ${count} -ge ${timeout} ]]; then
break
fi
done