-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-cluster.sh
61 lines (46 loc) · 1.78 KB
/
create-cluster.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
echo "-Set the default compute zone-"
PROJECT_ID=sacred-armor-346113
gcloud config set project $PROJECT_ID
gcloud config set compute/zone us-central1-f
echo "-Set the cluster name-"
CLUSTER_NAME=chatbot-cluster
echo "-Creating a Kubernetes cluster with 3 nodes in the default node pool-"
gcloud beta container clusters create $CLUSTER_NAME \
--cluster-version=latest \
--machine-type=n2d-highmem-8 \
--enable-autoscaling \
--enable-autorepair \
--min-nodes=1 \
--max-nodes=3 \
--num-nodes=1 \
--preemptible
# gcloud beta container node-pools create node-pool-1 \
# --cluster=$CLUSTER_NAME \
# --machine-type=n2d-highmem-4 \
# --preemptible \
# --min-nodes=1 \
# --max-nodes=3 \
# --num-nodes=1 \
# --enable-autoscaling \
# --enable-autorepair \
echo "-Check that the cluster is up and running-"
gcloud container clusters list
echo "-Get the credentials for you new cluster so you can interact with it using kubectl-"
gcloud container clusters get-credentials $CLUSTER_NAME
echo "-List the cluster's nodes-"
kubectl get nodes
echo "-Create new bucket-"
export MODEL_BUCKET=${PROJECT_ID}-bucket
gsutil mb gs://${MODEL_BUCKET}
echo "-After the bucket has been created copy the model files-"
gsutil cp -r gs://workshop-datasets/models/resnet_101 gs://${MODEL_BUCKET}
# echo "-Deploying a model-"
# kubectl apply -f tf-serving/configmap.yaml
# echo "Create TF Serving Deployment."
# kubectl apply -f tf-serving/deployment.yaml
# echo "Create TF Serving Service."
# kubectl apply -f tf-serving/service.yaml
echo "-Run terraform file to create configmap, deployment, and service-"
echo "-Then check the services by writing kubectl get svc image-classifier to check the External IP-"
# echo "-Get the external address for the TF Serving service-"
# kubectl get svc image-classifier