MicroServices

m

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

r

BackgroundThe contributors to this document have been directly involved in the development and deployment of hundreds of apps, and indirectly witnessed the development, operation, and scaling of hundreds of thousands of apps via our work on the Heroku platform.This document synthesizes all of our experience and observations on a wide variety of software-as-a-service apps in the wild. It is a triangulation on ideal practices for app development, paying particular attention to the dynamics of the organic growth of an app over time, the dynamics of collaboration between developers working on the app’s codebase, and avoiding the cost of software erosion.Our motivation is to raise awareness of some systemic problems we’ve seen in modern application development, to provide a shared vocabulary for discussing those problems, and to offer a set of broad conceptual solutions to those problems with accompanying terminology. The format is inspired by Martin Fowler’s books Patterns of Enterprise Application Architecture and Refactoring.

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

MachineLearning

m