MicroServices
Google Cloud Engine
CloudShell
Tutorial
Container (Docker)
// Set gcloud defaults
gcloud config set compute/zone us-central1-b
gcloud config list
// To view your gcloud defaults at any time
// Run a container image
gcloud container clusters create example-cluster
// Create a cluster (this step can take a few minutes to complete).
kubectl run hello-node --image=gcr.io/google-samples/node-hello:1.0 --port=8080
// Run the container
kubectl expose deployment hello-node --type="LoadBalancer"
// Expose the container. Note that the type="LoadBalancer option in kubectl requests that Google Cloud Platform provision a load balancer for your container.
kubectl get service hello-node
// Copy the external IP address for the hello-node app
// View the app (replace EXTERNAL-IP with the external IP address you obtained in the previous step).
// Clean up
gcloud container clusters delete example-cluster
// list
gcloud container clusters list
12 Factor App
Building Containers
Installing Apps With Native OS Tools
Containers
Docker
Kubernetes
What is Kubernetes
pets vs. cattle
diagram
vm/instance = single instance (pet)
pods = anonymous instance (cattle)
(setup)
Use project directory
cd $GOPATH/src/github/com/udacity/ud615/craft/kubernetes
??? where is craft ???
cd craft/kubernetes
Provision a Kubernetes Cluster with GKE using gcloud
gcloud container clusters create k0
(intro)
kubectl run nginx --image=nginx:1.10.0
// Launch a single instance:
kubectl get pods
// Get pods
kubectl expose deployment nginx --port 80 --type LoadBalancer
// Expose nginx
kubectl get services
// List services
// Kubernetes cheat sheet
Pods Intro
Logical Application
// One or more containers.
// That have dependencies with each other
// Shared namespace
// One IP per pod
(Pod)
nginx
monolith
JWT
JSON Web Tokens
What is
ssh
apt-get