Commit 24b06d80 authored by Warren Strange's avatar Warren Strange

Add preemtible option to master

parent b2600a65
...@@ -27,6 +27,8 @@ NODE_DISK_TYPE=${NODE_DISK_TYPE:-pd-standard} ...@@ -27,6 +27,8 @@ NODE_DISK_TYPE=${NODE_DISK_TYPE:-pd-standard}
NODE_DISK_SIZE=${NODE_DISK_SIZE:-100GB} NODE_DISK_SIZE=${NODE_DISK_SIZE:-100GB}
REGISTER_MASTER_KUBELET=${REGISTER_MASTER:-true} REGISTER_MASTER_KUBELET=${REGISTER_MASTER:-true}
PREEMPTIBLE_NODE=${PREEMPTIBLE_NODE:-false} PREEMPTIBLE_NODE=${PREEMPTIBLE_NODE:-false}
PREEMPTIBLE_MASTER=${PREEMPTIBLE_MASTER:-false}
OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-debian} OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-debian}
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-container-vm-v20160127} MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-container-vm-v20160127}
......
...@@ -28,6 +28,8 @@ NODE_DISK_SIZE=${NODE_DISK_SIZE:-100GB} ...@@ -28,6 +28,8 @@ NODE_DISK_SIZE=${NODE_DISK_SIZE:-100GB}
REGISTER_MASTER_KUBELET=${REGISTER_MASTER:-false} REGISTER_MASTER_KUBELET=${REGISTER_MASTER:-false}
KUBE_APISERVER_REQUEST_TIMEOUT=300 KUBE_APISERVER_REQUEST_TIMEOUT=300
PREEMPTIBLE_NODE=${PREEMPTIBLE_NODE:-false} PREEMPTIBLE_NODE=${PREEMPTIBLE_NODE:-false}
PREEMPTIBLE_MASTER=${PREEMPTIBLE_MASTER:-false}
OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-debian} OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-debian}
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-container-vm-v20160127} MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-container-vm-v20160127}
......
...@@ -46,6 +46,11 @@ function create-master-instance() { ...@@ -46,6 +46,11 @@ function create-master-instance() {
local address_opt="" local address_opt=""
[[ -n ${1:-} ]] && address_opt="--address ${1}" [[ -n ${1:-} ]] && address_opt="--address ${1}"
local preemptible_master=""
if [[ "${PREEMPTIBLE_MASTER}" == "true" ]]; then
preemptible_master="--preemptible --maintenance-policy TERMINATE"
fi
write-master-env write-master-env
gcloud compute instances create "${MASTER_NAME}" \ gcloud compute instances create "${MASTER_NAME}" \
${address_opt} \ ${address_opt} \
...@@ -60,5 +65,6 @@ function create-master-instance() { ...@@ -60,5 +65,6 @@ function create-master-instance() {
--can-ip-forward \ --can-ip-forward \
--metadata-from-file \ --metadata-from-file \
"kube-env=${KUBE_TEMP}/master-kube-env.yaml,user-data=${KUBE_ROOT}/cluster/gce/coreos/master.yaml,configure-node=${KUBE_ROOT}/cluster/gce/coreos/configure-node.sh,configure-kubelet=${KUBE_ROOT}/cluster/gce/coreos/configure-kubelet.sh" \ "kube-env=${KUBE_TEMP}/master-kube-env.yaml,user-data=${KUBE_ROOT}/cluster/gce/coreos/master.yaml,configure-node=${KUBE_ROOT}/cluster/gce/coreos/configure-node.sh,configure-kubelet=${KUBE_ROOT}/cluster/gce/coreos/configure-kubelet.sh" \
--disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no" --disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no" \
${preemptible_master}
} }
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
function create-master-instance { function create-master-instance {
local address_opt="" local address_opt=""
[[ -n ${1:-} ]] && address_opt="--address ${1}" [[ -n ${1:-} ]] && address_opt="--address ${1}"
local preemptible_master=""
if [[ "${PREEMPTIBLE_MASTER}" == "true" ]]; then
preemptible_master="--preemptible --maintenance-policy TERMINATE"
fi
write-master-env write-master-env
gcloud compute instances create "${MASTER_NAME}" \ gcloud compute instances create "${MASTER_NAME}" \
...@@ -48,7 +52,8 @@ function create-master-instance { ...@@ -48,7 +52,8 @@ function create-master-instance {
--can-ip-forward \ --can-ip-forward \
--metadata-from-file \ --metadata-from-file \
"startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh,kube-env=${KUBE_TEMP}/master-kube-env.yaml" \ "startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh,kube-env=${KUBE_TEMP}/master-kube-env.yaml" \
--disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no" --disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no" \
${preemptible_master}
} }
# $1: template name (required) # $1: template name (required)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment