@@ -795,6 +795,7 @@ function kctf_cluster_resize_usage {
795
795
echo -e " -h|--help print this help" >&2
796
796
echo -e " --machine-type machine type to use" >&2
797
797
echo -e " to list available types, run: gcloud compute machine-types list --zones=\" ${ZONE} \" " >&2
798
+ echo -e " --spot use spot VMs (reduced cost but no availability guarantees)" >&2
798
799
echo -e " --min-nodes (required) minimum number of nodes in the cluster" >&2
799
800
echo -e " --max-nodes (required) maximum number of nodes in the cluster" >&2
800
801
echo -e " --num-nodes (required) initial number of nodes in the cluster" >&2
@@ -809,7 +810,7 @@ function kctf_cluster_resize {
809
810
fi
810
811
811
812
OPTS=" h"
812
- LONGOPTS=" help,machine-type:,min-nodes:,max-nodes:,num-nodes:,pool-name:,old-pool:"
813
+ LONGOPTS=" help,machine-type:,spot, min-nodes:,max-nodes:,num-nodes:,pool-name:,old-pool:"
813
814
PARSED=$( ${GETOPT} --options=$OPTS --longoptions=$LONGOPTS --name " kctf cluster resize" -- " $@ " )
814
815
if [[ $? -ne 0 ]]; then
815
816
kctf_cluster_resize_usage
@@ -818,6 +819,7 @@ function kctf_cluster_resize {
818
819
eval set -- " $PARSED "
819
820
820
821
MACHINE_TYPE=" n2-standard-4"
822
+ SPOT=
821
823
MIN_NODES=
822
824
MAX_NODES=
823
825
NUM_NODES=
@@ -833,6 +835,10 @@ function kctf_cluster_resize {
833
835
MACHINE_TYPE=" $2 "
834
836
shift 2
835
837
;;
838
+ --spot)
839
+ SPOT=1
840
+ shift 1
841
+ ;;
836
842
--min-nodes)
837
843
MIN_NODES=" $2 "
838
844
shift 2
@@ -900,6 +906,7 @@ function kctf_cluster_resize {
900
906
gcloud container node-pools create " ${NEW_POOL_NAME} " \
901
907
--cluster=" ${CLUSTER_NAME} " \
902
908
--machine-type=" ${MACHINE_TYPE} " \
909
+ ${SPOT: +--spot} \
903
910
--enable-autorepair \
904
911
--enable-autoupgrade \
905
912
--num-nodes=" ${NUM_NODES} " \
0 commit comments