Skip to content

Commit ad5ece4

Browse files
committed
Add restart all other service feature to script
1 parent aa28386 commit ad5ece4

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

hotelReservation/noisy-neighbors/node-taint.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,17 @@ echo
7979
echo "=== Operation completed ==="
8080
if [ "$UNTOLERATE_MODE" == "true" ]; then
8181
echo "The taint has been removed from node '$NODE_NAME' and tolerations removed from deployment '$SERVICE_NAME'"
82-
echo
83-
echo "Verify with:"
84-
echo " kubectl describe node $NODE_NAME | grep -A5 Taints"
85-
echo " kubectl get deployment $SERVICE_NAME -o yaml | grep -A10 tolerations"
82+
if [ "$RESTART_ALL" == "true" ]; then
83+
echo "All deployments have been restarted and can now be scheduled on any available node"
84+
fi
8685
else
8786
echo "The deployment '$SERVICE_NAME' can now be scheduled on the tainted node '$NODE_NAME'"
88-
echo
89-
echo "Verify with:"
90-
echo " kubectl describe node $NODE_NAME | grep -A5 Taints"
91-
echo " kubectl get deployment $SERVICE_NAME -o yaml | grep -A10 tolerations"
92-
fi
87+
if [ "$RESTART_ALL" == "true" ]; then
88+
echo "All other deployments have been restarted and will avoid the tainted node (unless they have tolerations)"
89+
fi
90+
fi
91+
echo
92+
echo "Verify with:"
93+
echo " kubectl describe node $NODE_NAME | grep -A5 Taints"
94+
echo " kubectl get deployment $SERVICE_NAME -o yaml | grep -A10 tolerations"
95+
echo " kubectl get pods -o wide # Check pod distribution across nodes"

0 commit comments

Comments
 (0)