Skip to content

Commit fb12c48

Browse files
committed
AWS kube-up: Allow spot instances
I think we should probably leave this undocumented for now, until we have a better way to launch multiple sets of nodes, but it's great for cost savings while testing! Fix #21200
1 parent d089fa8 commit fb12c48

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cluster/aws/util.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,12 @@ function start-minions() {
11211121
else
11221122
public_ip_option="--no-associate-public-ip-address"
11231123
fi
1124+
local spot_price_option
1125+
if [[ -n "${NODE_SPOT_PRICE:-}" ]]; then
1126+
spot_price_option="--spot-price ${NODE_SPOT_PRICE}"
1127+
else
1128+
spot_price_option=""
1129+
fi
11241130
${AWS_ASG_CMD} create-launch-configuration \
11251131
--launch-configuration-name ${ASG_NAME} \
11261132
--image-id $KUBE_NODE_IMAGE \
@@ -1129,6 +1135,7 @@ function start-minions() {
11291135
--key-name ${AWS_SSH_KEY_NAME} \
11301136
--security-groups ${NODE_SG_ID} \
11311137
${public_ip_option} \
1138+
${spot_price_option} \
11321139
--block-device-mappings "${NODE_BLOCK_DEVICE_MAPPINGS}" \
11331140
--user-data "fileb://${KUBE_TEMP}/node-user-data.gz"
11341141

0 commit comments

Comments
 (0)