@leverege/build-tools 2.50.12 → 2.50.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/k8scale.sh +10 -2
package/package.json
CHANGED
package/src/k8scale.sh
CHANGED
|
@@ -19,8 +19,11 @@ case $DIRECTION in
|
|
|
19
19
|
REPLICAS=0
|
|
20
20
|
DIRECTION=down
|
|
21
21
|
;;
|
|
22
|
+
roll)
|
|
23
|
+
DIRECTION=roll
|
|
24
|
+
;;
|
|
22
25
|
*)
|
|
23
|
-
printf "Usage: `color g 'k8scale <up|dn|down> [deployment-list]'`\n\n" && exit 1
|
|
26
|
+
printf "Usage: `color g 'k8scale <up|dn|down|roll> [deployment-list]'`\n\n" && exit 1
|
|
24
27
|
esac
|
|
25
28
|
|
|
26
29
|
printf " scaled => `color g $DIRECTION`\n\n"
|
|
@@ -28,7 +31,12 @@ for DEPLOYMENT in "$@";
|
|
|
28
31
|
do
|
|
29
32
|
IFS="/" read SERVICE <<< "$DEPLOYMENT" # strip trailing /
|
|
30
33
|
RESULTS="`color g SUCCESS`"
|
|
31
|
-
|
|
34
|
+
if [ "$DIRECTION" == "roll" ];
|
|
35
|
+
then
|
|
36
|
+
kubectl rollout restart deployment $SERVICE &> $DEVNULL
|
|
37
|
+
else
|
|
38
|
+
kubectl scale --replicas=$REPLICAS deployment $SERVICE &> $DEVNULL
|
|
39
|
+
fi
|
|
32
40
|
[ $? -eq 1 ] && RESULTS="`color r FAILURE`"
|
|
33
41
|
printf " $RESULTS => $SERVICE\n"
|
|
34
42
|
sendToSlack "k8scale $DIRECTION $SERVICE"
|