forked from chrisbutner/ChessCoach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster-up.sh
executable file
·32 lines (27 loc) · 964 Bytes
/
cluster-up.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
set -eux
pushd "$(dirname "$0")"
source cluster-common.sh
source cluster-prep-creds.sh
# Taint the default node pool so that critical system pods like "kube-dns" are instead scheduled on
# our separate critical node pool, which isn't preemptible.
gcloud container clusters create \
--cluster-version=${CLUSTER_VERSION} \
--scopes=cloud-platform \
--enable-ip-alias \
--enable-tpu \
--machine-type ${MACHINE_TYPE} \
--disk-size ${DISK_SIZE} \
--preemptible \
--num-nodes ${NUM_NODES} \
--node-taints=dedicated=preemptible:NoSchedule \
${CLUSTER_NAME}
gcloud container node-pools create \
--cluster=${CLUSTER_NAME} \
--scopes=cloud-platform \
--machine-type ${CRITICAL_MACHINE_TYPE} \
--disk-size ${CRITICAL_DISK_SIZE} \
--num-nodes ${CRITICAL_NUM_NODES} \
${CRITICAL_NAME}
kubectl create secret generic ${CREDENTIALS_NAME} --from-file=key.json=${SERVICE_ACCOUNT_KEY_PATH}
popd