今すぐ始めるCloud Foundry #hackt #hackt_k

123
‹#› © 2016 Pivotal Software, Inc. All rights reserved. Cloud Foundry Toshiaki Maki (@making) 2016-09-10 Hacker Tackle #hackt #hackt_k

Transcript of 今すぐ始めるCloud Foundry #hackt #hackt_k

Page 1: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved. ‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud FoundryToshiaki Maki (@making) 2016-09-10 Hacker Tackle #hackt #hackt_k

Page 2: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Who am I ?• Toshiaki Maki (@making) http://blog.ik.am

•Sr. Solutions Architect @Pivotal

•Spring Framework enthusiast

bit.ly/hajiboot2

Page 3: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Who am I ?• Toshiaki Maki (@making) http://blog.ik.am

•Sr. Solutions Architect @Pivotal

•Spring Framework enthusiast

bit.ly/hajiboot2

Page 4: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

•Cloud Foundry

•Cloud Foundry

•Cloud Foundry

•Cloud Foundry

•Cloud Foundryhttps://github.com/making/hacker-tackle-demo

Page 5: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

•Cloud Foundry

•Cloud Foundry

•Cloud Foundry

•Cloud Foundry

•Cloud Foundry

Cloud Foundry

https://github.com/making/hacker-tackle-demo

Page 6: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud Foundry

Page 7: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

• PaaS •Cloud Foundry Foundation

• /

https://github.com/cloudfoundry

Page 8: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

• PaaS •Cloud Foundry Foundation

• /

https://github.com/cloudfoundry

Cloud Native Platform

Page 9: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

• • • • /

• •

Page 10: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

• • • • /

• •

Page 11: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

• • • • /

• •

!!!!

Page 12: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud Foundry

• (DNS)

• • • • • •

Page 13: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud Foundry everywhere

Cloud Foundry

Cloud Foundry

OSS Pivotal Cloud Foundry

on Private Cloud

on Public Cloud

Page 14: 今すぐ始めるCloud Foundry #hackt #hackt_k

Structure

Spring Cloud Spring Boot

Cloud Foundry

BOSH

AWSVMWareOpenStack

Application Framework

Runtime Platform

Infrastructure Automation

InfrastructureAzure

Contract: Cloud Provider Interface

Contract: 12 Factor App

Contract: BOSH Release

Java EE

GCP

Page 15: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud Foundry

Page 16: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

$ cf login -a https://api.local.pcfdev.io --skip-ssl-validation

$ cf login -a https://api.run.pivotal.io

$ cf login -a https://api.system.your-cf.example.com

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

https://github.com/cloudfoundry/cli/releases

Page 17: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

cf push

Page 18: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

cf push

Page 19: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

$ cf push hello -p hello.jar

$ cf push hello

glide godep

app nameSpring Boot

Page 20: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

$ cf push hello -p hello.jar

$ cf push hello

glide godep

app nameSpring Boot

func main() { http.HandleFunc("/", func(w http.ResponseWriter , r *http.Request) { fmt.Fprint(w, "Hello World!") }) http.ListenAndServe(":"+os.Getenv("PORT"), nil);}

Page 21: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Hello World

Host name (subdomain) =app name

domain name

-n

Page 22: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

cf scale

Page 23: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

cf scale

Page 24: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

$ cf scale app-name -i 4

$ cf scale app-name -m 2g

Page 25: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Demo

https://www.youtube.com/watch?v=_TpvipmGisc

Page 26: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Deploying an ApplicationIaaS Cloud Foundry

Configure Firewall

Configure Service Connectivity

Configure SSL

Configure Load Balancer

Deploy Application

Install Application Runtime

Provision a VM

cf push

Page 27: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Scaling an ApplicationIaaS Cloud Foundry

Configure Firewall

Configure Service Connectivity

Configure SSL

Configure Load Balancer

Deploy Application

Install Application Runtime

Provision a VM

cf scale

Page 28: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Scaling an ApplicationIaaS Cloud Foundry

Configure Firewall

Configure Service Connectivity

Configure SSL

Configure Load Balancer

Deploy Application

Install Application Runtime

Provision a VM

cf scale!!

Page 29: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud Foundry

Page 30: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud Foundryhttp://docs.cloudfoundry.org/concepts/diego/diego-architecture.html

Page 31: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Architecture (Super Simplified)

CloudController

Blobstore DB

Cell

cfpush

http://...

CCAPI

Containers

Router

Page 32: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Architecture (Super Simplified)

CloudController

Blobstore DB

Cell

cfpush

http://...

CCAPI

Containers

Router

RunC

Page 33: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

! Upload

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

App

Page 34: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

! Upload

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

App

Page 35: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

" Stage

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Page 36: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

" Stage

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Page 37: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

" Stage

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

RuntimeApp

JRE,AppServeretc..

Page 38: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

" Stage

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

RuntimeApp

Page 39: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

" Stage

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

RuntimeApp

Droplet

Page 40: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

" Stage

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Upload

Page 41: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

" Stage

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Upload

Page 42: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

" Stage

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Page 43: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

# Start

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Page 44: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

# Start

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Page 45: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

# Start

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Page 46: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

# Start

CloudController

Blobstore DB

Cell

cfpush CCAPIRo

uter

Page 47: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

# Start

CloudController

Blobstore DB

Cellhttp://…

CCAPIRo

uter

Page 48: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Scale out

CloudController

Blobstore DB

Cellhttp://…

CCAPIRo

uter

cfscale

Page 49: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Scale out

CloudController

Blobstore DB

Cellhttp://…

CCAPIRo

uter

cfscale

Page 50: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Scale out

CloudController

Blobstore DB

Cellhttp://…

CCAPIRo

uter

cfscale

Page 51: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Scale out

CloudController

Blobstore DB

Cellhttp://…

CCAPIRo

uter

cfscale

Page 52: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Scale out

CloudController

Blobstore DB

Cellhttp://…

CCAPIRo

uter

cfscale

Page 53: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Buildpack

$ cf push

$ cf push -b https://github.com/<you>/java-buildpack.git

Auto Detect

Custom Buildpack

RuntimeApp

buildpack

https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks

$ cf push -b java_buildpackManual

Page 54: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cell

Docker

Page 55: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cell

Docker

Page 56: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Docker$ cf push demo-docker \ --docker-image \ cloudfoundry/lattice-app

Page 57: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Docker$ cf push demo-docker \ --docker-image \ cloudfoundry/lattice-app

CF 👇 !!

bit.ly/cf-container

Page 58: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud Foundry

Page 59: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

• • • •Blue / Green

• Zero Downtime Update

Page 60: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

http://12factor.net/backing-services

Page 61: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

$cfmarketplace

Page 62: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

$cfmarketplacePivotal Web Services

Page 63: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Create & Bind Service

$ cf create-service cleardb spark mydb

$ cf bind-service hello mydb

<ServiceName> <PlanName> <ServiceInstanceName>

<ServiceInstanceName><AppName>

MySQL

Page 64: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

VCAP_SERVICES{"cleardb":[{"credentials":{"hostname":"us-cdbr-iron-east-03.cleardb.net","jdbcUrl":"jdbc:mysql://us-cdbr-iron-east-03.cleardb.net/ad_1191b396cc81848","name":"ad_1191b396cc81848","password":"67674107","port":"3306","uri":"mysql://b6f7c089a1680f:67674107@...","username":"b6f7c089a1680f"},"label":"cleardb","tags":["mysql",...],"name":"mydb",...}]}

Page 65: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Go (go-simplejson)

import "github.com/bitly/go-simplejson"

json, _ := simplejson.NewJson([]byte(os.Getenv("VCAP_SERVICES")))credentials := json.Get("cleardb").GetIndex(0) .Get("credentials").MustMap()uri, _ := credentials["uri"].(string)u, _ := url.Parse(uri)url := fmt.Sprintf("%s@tcp(%s)%s", u.User.String(), u.Host, u.Path)

Page 66: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Go (go-cfenv)

import cfenv "github.com/cloudfoundry-community/go-cfenv"

appEnv, err := cfenv.Current()mydb, err := appEnv.Services.WithName("mydb")

uri, _ := mydb.Credentials["uri"].(string)u, _ := url.Parse(uri)url := fmt.Sprintf("%s@tcp(%s)%s", u.User.String(), u.Host, u.Path)

Page 67: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Java (Jackson)

JsonNode credentials = objectMapper .readTree(System.getenv("VCAP_SERVICES")) .get("cleardb").get(0).get("credentials");String url = credentials.get("jdbcUrl").asText();

Page 68: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Java (Spring)

@Configurationpublic class CloudConfig extends AbstractCloudConfig {

@BeanDataSource dataSource() {

return connectionFactory().dataSource();}

}

http://cloud.spring.io/spring-cloud-connectors/ Spring Cloud Connectors

Page 69: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Service Broker / User Provided Application

ServiceBroker

ServiceInstance

UserProvidedService

ManagedServicesMySQL

RedisRabbitMQ OracleDB

create-user-provided-servicecreate-service

bind-service

marketplace

Page 70: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

User Provided Service

$cfcreate-user-provided-servicemydb\-p'{"username":"xxx","password":"xxx","port":"xxx","jdbcUrl":"xxx"}'

$cfbind-servicehellomydb

(Oracle DB )

Page 71: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Log$cflogshello

Page 72: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

3rd Party Log Managers$ cf create-user-provided-service mylog \ -l syslog://xxxxxxxx-logit.io:36129$ cf bind-service hello mylog

Page 73: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

PCF Metrics https://metrics.run.pivotal.io/ for Pivotal Web Services

Page 74: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

4 Layers HA

PCF

3. Resurrector restarts failed VMs

App Fail Platform Fail VM Fail Rack Fail

PCFA B C

B

1. 2.

PCFVM

PCFA B C

Process

PCFA B C

VM1 VM2

OS, Mware

VMPCF VM kill

3.

VM3

OS, Mware

OS, Mware

PCFZone

Distribution

4.

Zone 2Zone 1

VM1 VM2

Page 75: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Demo`

https://www.youtube.com/watch?v=26RrBiBymeA

Page 76: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment• 0

V1

Router

$ cf push v1 -n app

app.example.co

m

Page 77: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

V2

app-g.example.com

app.example.co

m

$ cf push v2 -n app-g

Page 78: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

V2

app-g.example.com

app.example.co

m

app.example.com

$ cf map-route v2 example.com -n app

Page 79: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

V2

app-g.example.com

app.example.com

$ cf unmap-route v1 example.com -n app

Page 80: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

V2

app-g.example.com

app.example.com😊

$ cf unmap-route v1 example.com -n app

Page 81: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

V2

app-g.example.com

app.example.com

Page 82: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

app-g.example.com

app.example.com😱

Page 83: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

V2

app-g.example.com

app.example.com😱

🔥app.e

xample.com

$ cf map-route v1 example.com -n app

Page 84: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

V2

app-g.example.com 😱🔥

app.example.co

m

$ cf unmap-route v2 example.com -n app

Page 85: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

V1

Router

V2

app-g.example.com

app.example.com😊

$ cf delete v1

Page 86: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

Router

V2

app-g.example.com

app.example.com😊

$ cf delete v1

Page 87: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Blue/Green Deployment

Router

V2

app.example.com

$ cf unmap-route v2 example.com -n app-g

Page 88: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Demo

https://www.youtube.com/watch?v=2LtsURDvMF0

Page 89: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Zero Downtime Update• ) JVM

https://github.com/concourse/autopilot

$ cf zero-downtime-push app-name -f manifest.yml

Page 90: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Demo

https://www.youtube.com/watch?v=mbvg8wijs4Y

Page 91: 今すぐ始めるCloud Foundry #hackt #hackt_k

© Copyright 2016 Pivotal. All rights reserved. 66

Upgrade and patch with rolling “canary” deploys

4

X YM NA B

A,B,M,N,X,Y - Application instances

- VM prior to update

Page 92: 今すぐ始めるCloud Foundry #hackt #hackt_k

© Copyright 2016 Pivotal. All rights reserved. 67

Upgrade and patch with rolling “canary” deploys

5

X YM NA BApps redeployed to clear VMs

X YM NA B

Page 93: 今すぐ始めるCloud Foundry #hackt #hackt_k

© Copyright 2016 Pivotal. All rights reserved. 68

Upgrade and patch with rolling “canary” deploys

6

X YM NA B

X YM NA BUpdate introduced. If the tests pass, keep going

X YM NA B

Page 94: 今すぐ始めるCloud Foundry #hackt #hackt_k

© Copyright 2016 Pivotal. All rights reserved. 69

Upgrade and patch with rolling “canary” deploys

7

X YM NA B

X YM NA B

X YM NA B

Apps redeployed to updated VMs

X YM NA B

Page 95: 今すぐ始めるCloud Foundry #hackt #hackt_k

© Copyright 2016 Pivotal. All rights reserved. 70

Upgrade and patch with rolling “canary” deploys

8

X YM NA B

X YM NA B

X YM NA B

X YM NA B

Remaining VMs updated same way

X YM NA B

Page 96: 今すぐ始めるCloud Foundry #hackt #hackt_k

© Copyright 2016 Pivotal. All rights reserved. 71

Upgrade and patch with rolling “canary” deploys

9

X YM NA B

X YM NA B

X YM NA B

X YM NA B

X YM NA B

Automated, No downtime Atomic rolling update

X YM NA B

Page 97: 今すぐ始めるCloud Foundry #hackt #hackt_k

© Copyright 2016 Pivotal. All rights reserved. 72

Upgrade and patch with rolling “canary” deploys

Page 98: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

New Features•Routing Service •TCP Routing •Persistent Volume

Page 99: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Cloud Foundry

Page 100: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CFPCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Page 101: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Page 102: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Page 103: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Page 104: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

Page 105: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

Page 106: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

Page 107: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

Page 108: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

Page 109: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

Page 110: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

No ( )

Page 111: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

No ( )

Page 112: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

No ( )

Yes

Page 113: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

No ( )

Yes

Page 114: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

No ( )

Yes

Yes

Page 115: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

No ( )

Yes

Yes

Page 116: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

No ( )

Yes

Yes

No (OSS)

Page 117: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

CF

PCF Dev

Pivotal Web Services

Pivotal Cloud Foundry

Cloud Foundry (OSS)

Yes

Yes

No ( )

No ( )

No ( )

Yes

Yes

No (OSS)

Page 118: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

PCF Dev•Cloud Foundry (on VirtualBox) • http://pcfdev.io https://docs.pivotal.io/pcf-dev • cf dev start / stop • •Redis •RabbitMQ •MySQL •Spring Cloud Services

Page 119: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Pivotal Web Services• https://run.pivotal.io/ •AWS Pivotal Cloud Foundry • 1GB $0.03/

• 1: Java 1GB ➡ 2200 /

• 2: Go 64MB ➡ 135 / , 8MB➡ 17 /

• $87 (2GB 2 , 1 ) • •PCF Metrics, Auto Scaler (Docker )

Page 120: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Pivotal Cloud Foundry• https://pivotal.io/platform •Cloud Foundry • AppsManager

• vSphere, AWS, OpenStack CF(OpsManager) Azure

GCP • OSS

All in One

Page 121: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Spring Boot [ ]• http://bit.ly/hajiboot2

• Java Spring Boot 1.4

•Pivotal Web Services

Blue/Green

Page 122: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Spring Boot [ ]• http://bit.ly/hajiboot2

• Java Spring Boot 1.4

•Pivotal Web Services

Blue/Green

Cloud Foundry!!!!

Page 123: 今すぐ始めるCloud Foundry #hackt #hackt_k

‹#›© 2016 Pivotal Software, Inc. All rights reserved.

Spring Boot [ ]• http://bit.ly/hajiboot2

• Java Spring Boot 1.4

•Pivotal Web Services

Blue/Green

Cloud Foundry!!!!

!!