mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
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
This commit is contained in:
parent
d089fa8030
commit
fb12c48cb7
@ -1121,6 +1121,12 @@ function start-minions() {
|
|||||||
else
|
else
|
||||||
public_ip_option="--no-associate-public-ip-address"
|
public_ip_option="--no-associate-public-ip-address"
|
||||||
fi
|
fi
|
||||||
|
local spot_price_option
|
||||||
|
if [[ -n "${NODE_SPOT_PRICE:-}" ]]; then
|
||||||
|
spot_price_option="--spot-price ${NODE_SPOT_PRICE}"
|
||||||
|
else
|
||||||
|
spot_price_option=""
|
||||||
|
fi
|
||||||
${AWS_ASG_CMD} create-launch-configuration \
|
${AWS_ASG_CMD} create-launch-configuration \
|
||||||
--launch-configuration-name ${ASG_NAME} \
|
--launch-configuration-name ${ASG_NAME} \
|
||||||
--image-id $KUBE_NODE_IMAGE \
|
--image-id $KUBE_NODE_IMAGE \
|
||||||
@ -1129,6 +1135,7 @@ function start-minions() {
|
|||||||
--key-name ${AWS_SSH_KEY_NAME} \
|
--key-name ${AWS_SSH_KEY_NAME} \
|
||||||
--security-groups ${NODE_SG_ID} \
|
--security-groups ${NODE_SG_ID} \
|
||||||
${public_ip_option} \
|
${public_ip_option} \
|
||||||
|
${spot_price_option} \
|
||||||
--block-device-mappings "${NODE_BLOCK_DEVICE_MAPPINGS}" \
|
--block-device-mappings "${NODE_BLOCK_DEVICE_MAPPINGS}" \
|
||||||
--user-data "fileb://${KUBE_TEMP}/node-user-data.gz"
|
--user-data "fileb://${KUBE_TEMP}/node-user-data.gz"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user