-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcluster-up
executable file
·33 lines (28 loc) · 909 Bytes
/
cluster-up
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
33
#!/bin/bash
DIR="$(dirname "$0")"
. "${DIR}/config"
# API
gcloud services enable \
cloudapis.googleapis.com \
container.googleapis.com \
containerregistry.googleapis.com
# Cluster
gcloud beta container clusters create $CLUSTER_NAME \
--addons=HorizontalPodAutoscaling,HttpLoadBalancing,CloudRun \
--zone $CLUSTER_ZONE \
--cluster-version $CLUSTER_MASTER_VERSION \
--machine-type $CLUSTER_NODE_MACHINE_TYPE \
--num-nodes $CLUSTER_START_NODE_SIZE \
--min-nodes 1 \
--max-nodes $CLUSTER_MAX_NODE_SIZE \
--enable-ip-alias \
--enable-stackdriver-kubernetes \
--enable-autoscaling \
--enable-autorepair \
--scopes cloud-platform
# credentials and binding
gcloud container clusters get-credentials $CLUSTER_NAME \
--zone $CLUSTER_ZONE
kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole=cluster-admin \
--user=$(gcloud config get-value core/account)