Develop Denver, October 18, 2018
- Build an app
- The Node.js app is done! See
package.json
,index.js
, and thepublic
directory - Run
npm install
andnpm start
to run the app locally
- The Node.js app is done! See
- Turn the app into a Docker image
- See
Dockerfile
docker build -t kimschles/dvlp-2018 .
- To create a container locally, run
docker run -p 8080:8080 kimschles/dvlp-2018
- See the app at
http://localhost:8080/
- See
- Push the image to a registry
docker push kimschles/dvlp-2018
- https://hub.docker.com/r/kimschles/dvlp-2018/
- Create a K8s cluster with GKE
- Go to https://cloud.google.com/
- Create a project
- Create a cluster with Google Kubernetes Engine
- Connect with Cloud Shell
git clone
this repocd beginners_guide_to_k8s
- Deploy the app to a cluster
kubectl apply -f app/namespace.yml
kubectl apply -f app/deployment.yml
- Expose the app to the internet
kubectl expose deployment kitten-game -n dvlp-k8s --type="LoadBalancer"
- Add some cool K8s stuff
- Increase the number of replicas
- Horizontal Pod AutoScaler
- Test with Apache Bench
ab -n 30000 -c 100 http://[external_ip]:[port]/
- Test with Apache Bench
- Rolling Updates