Lucía Brizuela

34
Nov 2016 First 90 Docker + Cloud

Transcript of Lucía Brizuela

Page 1: Lucía Brizuela

Nov 2016

First 90Docker + Cloud

Page 2: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Variedad de tecnologías

Page 3: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Variedad de tecnologías

+

Page 4: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Variedad de tecnologías

+ +

Page 5: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Una sola tecnología

“Docker es una forma de ejecutar procesos de

forma aislada, por medio de la generación de

containers.”

Page 6: Lucía Brizuela

Demo

Page 7: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Dockerfile

FROM golang:1.6-onbuild

Page 8: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Preparar y ejecutar la aplicación

docker build -t myapp .

docker run -p 8080:8080 myapp

Page 9: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Docker Compose

+

Page 10: Lucía Brizuela

Demo

Page 11: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

docker-compose.ymlapp:

build: .ports:- “8080:8080”volumes:- .:/go/src/app

postgres:image: postgres:latestenvironment:- POSTGRES_USER=test- POSTGRES_PASSWORD=test

Page 12: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Ejecutar la aplicación y servicios

docker-compose build

docker-compose up -d

Page 13: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Publicar la imagen de la aplicación

https://hub.docker.com/

docker login -u USER -p PASSWORD

docker push USER/myapp

Page 14: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Ventajas de Docker en Desarrollo

+ Simplificar el setup del entorno.

+ Generar nuevos ambientes.

+ Documentar dependencias

externas.

+ Simular Producción localmente.

Page 15: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Cloud

+

Page 16: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

VPC 10.0.0.0/16

Componentes en AWS

Page 17: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

us-east-

1a

VPC 10.0.0.0/16

Subnet10.0.0.0/24

Componentes en AWS

Page 18: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

us-east-

1a

VPC 10.0.0.0/16

Subnet10.0.0.0/24

Router

Componentes en AWS

Page 19: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

us-east-

1a

VPC 10.0.0.0/16

Subnet10.0.0.0/24

Router Internet

Gateway

Componentes en AWS

Page 20: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

us-east-

1a

VPC 10.0.0.0/16

Subnet10.0.0.0/24

Router Internet

Gateway

Componentes en AWS

ACL

Page 21: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

us-east-

1aus-east-

1bus-east-

1cus-east-

1d

VPC 10.0.0.0/16

Subnet10.0.0.0/24

Componentes en AWS

Subnet10.1.0.0/24

Subnet10.2.0.0/24

Subnet10.3.0.0/24

Page 22: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

VPC 10.0.0.0/16

Componentes en AWS

Elastic Load Balancer

Page 23: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

VPC 10.0.0.0/16

Componentes en AWS

Elastic Load Balancer

Instancia

Instancia

Instancia

Instancia

Page 24: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

VPC 10.0.0.0/16

Componentes en AWS

Elastic Load Balancer

Auto Scaling Group

Instancia

Instancia

Instancia

Instancia

Page 25: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

VPC 10.0.0.0/16

Componentes en AWS

Elastic Load Balancer

Auto Scaling Group

Instancia

Instancia

Instancia

Instancia

Security Group

Page 26: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

CloudFormation

“Ofrece un método sencillo de crear una colección de recursos de AWS relacionados

entre sí para ofrecerlos de una manera

ordenada y predecible.”

Page 27: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

template.json{

“Parameters”: { ... },

”Resources”: { ... },

”Outputs”: { ... }}

Page 28: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

template.json{

“Parameters”: {“CustomCird”: {

“Type”: “String”,“Description”: “Rango de ips de la VPC”

}},

”Resources”: { ... },”Outputs”: { ... }

}

Page 29: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

template.json{

“Parameters”: { ... },”Resources”: {

“MyVpc”: {“Type”: “AWS::EC2::VPC”,“Parameters”: {

“CidrBlock”: { “Ref”: “CustomCird”}}

}},

”Outputs”: { ... }}

Page 30: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

template.json{

“Parameters”: { ... },”Resources”: { ... },”Outputs”: {

“VpcID”: {“Value”: { “Ref”: “MyVpc” }

}}

}

Page 31: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Crear un Stack

aws cloudformation create-stack--stack-name myApp--template-body

file://path/template.json--parameters CustomCidr=10.0.0.0/24

Page 32: Lucía Brizuela

Demo

Page 33: Lucía Brizuela

This is our visionBuilding the foundation to Build a 3B Company by FY20

Otras opciones

+ Elastic Beanstalk

+ ECS Container Service

Page 34: Lucía Brizuela

Muchasgracias