- Create the
term-project
cluster on google cloud, preferably in the same region/zone as the dbgcloud container clusters create term-project --preemptible --zone=us-central1-b --num-nodes 3 --enable-autoscaling --min-nodes 1 --max-nodes 6 --workload-pool=cedar-booth-287414.svc.id.goog
- the
--workload-pool
option is required to bind kubernetes service accounts to gcp service accounts. More info. - the
--enable-autoscaling
option along with the--min-nodes 1 --max-nodes 6
options allow the node pool to auto scale resources as needed to provide the resources requested by pods in thek8s.yml
. More info
- the
- Create GCP service accounts
term-project-worker
andterm-project-server
.term-project-server
needsCloud SQL Client
,Service Account Token Creator
, andStorage Object Creator
rolesterm-project-worker
needsCloud SQL Client
,Logs Writer
,Monitoring Metric Writer
, andStorage Object Viewer
roles
- Ensure you are using the correct k8s context before proceeding with the
apply
commands next by checkingkubectl config get-contexts
. Switch to the one forterm-project
if necessary withkubectl config use-context <context-name>
. - Apply secrets using
kubectl apply -f k8s/secrets.yml
. The secrets.yml should look like:apiVersion: v1 kind: Secret metadata: name: term-project type: Opaque stringData: RABBITMQ_USER: <value> RABBITMQ_PWD: <value> PG_USER: <value> PG_PWD: <value>
- Enable http load balancing for the cluster with
gcloud container clusters update term-project --update-addons=HttpLoadBalancing=ENABLED
- See the load balancign tutorial here
- Deploy the cluster with
kubectl apply -f k8s/k8s.yml
, or by using the cloud build trigger. This will also create the kubernetes service accounts. - Relate GCP service accounts with GKE service accounts:
gcloud iam service-accounts add-iam-policy-binding --role roles/iam.workloadIdentityUser --member "serviceAccount:cedar-booth-287414.svc.id.goog[default/term-project-server]" [email protected] gcloud iam service-accounts add-iam-policy-binding --role roles/iam.workloadIdentityUser --member "serviceAccount:cedar-booth-287414.svc.id.goog[default/term-project-worker]" [email protected] # the stuff below is actually already done by the k8s/k8s.yml, but heres how to do it via command line if needed # it probably is technically better to do via command line, since it requires specifying project id and gcp specific service accounts, and commiting these to the repo isn't ideal kubectl annotate serviceaccount term-project-server iam.gke.io/gcp-service-account=term-project-server@cedar-booth-287414.iam.gserviceaccount.com kubectl annotate serviceaccount term-project-worker iam.gke.io/gcp-service-account=term-project-worker@cedar-booth-287414.iam.gserviceaccount.com
csci-5253-term-project's Introduction
csci-5253-term-project's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.