Skip to content

Commit b874fc5

Browse files
committed
Wait for resources to be deleted on cluster update
(cherry picked from commit 5566e6a)
1 parent 5e73122 commit b874fc5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

manager/install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,25 @@ function main() {
122122
echo "✓ configured autoscaling"
123123

124124
kubectl -n=cortex delete --ignore-not-found=true daemonset fluentd >/dev/null 2>&1 # Pods in DaemonSets cannot be modified
125+
until [ "$(kubectl -n=cortex get pods -l app=fluentd -o json | jq -j '.items | length')" -eq "0" ]; do sleep 1; done
125126
envsubst < manifests/fluentd.yaml | kubectl apply -f - >/dev/null
126127
echo "✓ configured logging"
127128

128129
kubectl -n=cortex delete --ignore-not-found=true daemonset cloudwatch-agent-statsd >/dev/null 2>&1 # Pods in DaemonSets cannot be modified
130+
until [ "$(kubectl -n=cortex get pods -l name=cloudwatch-agent-statsd -o json | jq -j '.items | length')" -eq "0" ]; do sleep 1; done
129131
envsubst < manifests/metrics-server.yaml | kubectl apply -f - >/dev/null
130132
envsubst < manifests/statsd.yaml | kubectl apply -f - >/dev/null
131133
echo "✓ configured metrics"
132134

133135
if [[ "$CORTEX_INSTANCE_TYPE" == p* ]] || [[ "$CORTEX_INSTANCE_TYPE" == g* ]]; then
134136
kubectl -n=cortex delete --ignore-not-found=true daemonset nvidia-device-plugin-daemonset >/dev/null 2>&1 # Pods in DaemonSets cannot be modified
137+
until [ "$(kubectl -n=kube-system get pods -l name=nvidia-device-plugin-ds -o json | jq -j '.items | length')" -eq "0" ]; do sleep 1; done
135138
envsubst < manifests/nvidia.yaml | kubectl apply -f - >/dev/null
136139
echo "✓ configured gpu support"
137140
fi
138141

139-
kubectl -n=cortex delete --ignore-not-found=true deployment operator >/dev/null 2>&1
142+
kubectl -n=cortex delete --ignore-not-found=true --grace-period=10 deployment operator >/dev/null 2>&1
143+
until [ "$(kubectl -n=cortex get pods -l workloadID=operator -o json | jq -j '.items | length')" -eq "0" ]; do sleep 1; done
140144
envsubst < manifests/operator.yaml | kubectl apply -f - >/dev/null
141145
echo "✓ started operator"
142146

0 commit comments

Comments
 (0)