Skip to content

jdeskins/nodejs-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Container Engine Walkthrough

Set project as variable to avoid re-typing:

export PROJECT_ID=[YOUR_PROJECT_ID]

Create Docker image

docker build -t gcr.io/${PROJECT_ID}/hello-node .

Push image to Google Container Registry

gcloud docker push gcr.io/${PROJECT_ID}/hello-node

Create cluster

gcloud container clusters create hello-world --num-nodes 1 --machine-type g1-small

gcloud compute instances list

Create pod

kubectl run hello-node --image=gcr.io/${PROJECT_ID}/hello-node --port=8080

Allow external traffic

kubectl expose rc hello-node --type="LoadBalancer"

kubectl get services hello-node

Scale up

kubectl scale rc hello-node --replicas=3

Cleanup

Services

kubectl delete services hello-node

Pods

kubectl delete rc hello-node

Cluster

gcloud container clusters delete hello-world

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published