-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcluster_create.sh
More file actions
executable file
·27 lines (15 loc) · 889 Bytes
/
cluster_create.sh
File metadata and controls
executable file
·27 lines (15 loc) · 889 Bytes
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
# Connect Kubernetes Cluster
gcloud container clusters get-credentials <CLUSTER_NAME> --zone <ZONE> --project <GCP_PROJECT_ID>
# Create Secret for POD to use Service Account
kubectl create secret generic cloudsql-instance-credentials --from-file=credentials.json=key.json
# DB Credentials
kubectl create secret generic cloudsql-db-credentials --from-literal=username=<DB_USER> --from-literal=password=<DB_PASSWORD>
cd ~/.kube
# kubernetes configuration file to connect cluster from inside POD
kubectl create configmap kube-config --from-file=config
# Deployment yaml, which publishes messages on pubsub
kubectl create configmap invoker-config --from-file=invoker.yaml
# Batch Jobs YAML, which acts as subscriber
kubectl create configmap subscriber-config --from-file=subscriber.yaml
# Project ID
kubectl create secret generic gcp-project-id --from-literal=PROJECT=$PROJECT_ID