senior cloud architect twitter: @javiernetes javier ... · blue/green deployment en aws from...
Post on 15-Oct-2020
0 Views
Preview:
TRANSCRIPT
www.ackstorm.es
javier.domingo@ackstorm.esTwitter: @javiernetes
Senior Cloud Architect
www.ackstorm.es
Blue/Green Deployment con Jenkins y Docker en AWS.
#AWSBcn
www.ackstorm.es
Qué es el Blue/Green Deployment
1. Provisión de recursos auxiliares. Balanceadores,
configuraciones, roles.
2. Despliegue de la versión 1 y configuración de tráfico y
servicio (Green).
3. Creación de versión 2 y puesta en disposición de entrar
en producción(Blue).
4. Switch traffic from version 1 to version 2. Green to Blue
5. Delete Version 1. Run versión 2 as green and return
traffic to Green.
www.ackstorm.es
Por qué usamos Blue/Green Deployment
1º Facilitar paso a producción
2º Para evitar la pérdida de servicio -
Downtime.
3º Acelerar la puesta en marcha y Software
cicle.
4º Necesario para Continuous Delivery.
www.ackstorm.es
Blue/Green Deployment en AWS
ref medium.com
1. DNS way + La vía fácil
- Tiempo de propagación de dns
- Vuelta atrás de infarto
- 1 subida cada 24 horas?
www.ackstorm.es
Blue/Green Deployment en AWS
ref loudnative.io
2. Elastic Load Balander + Vía fácil
- Warm up en balanceadores.
- Registro de las instancias en ELB
(Manocerdos)
- Ojo con los heathchecks.
- No es automático (scriptar?)
www.ackstorm.es
Blue/Green Deployment en AWS
ref http://docs.aws.amazon.com/
3. Elastic Beanstalk + Paas
+ Container Philosophy
- I like AWS but looking vendor.
- It uses ‘de facto’ a DNS changing.
www.ackstorm.es
Blue/Green Deployment en AWS
from blogs.aws.amazon.com
4. CloudFormation + Funciona en AWS (It works)
+ Paas
+ Container Philosophy
- I like AWS but locking vendor.
- Speed and deployment de complex
configurations.
www.ackstorm.es
Old school
from loudnative.io
4. Rsync, GlusterFS, Capistrano... - Old way
- What's happens if changing in Prod
infrastructure.
- Ventanas de mantenimiento (QUÉ??).
www.ackstorm.es
Continuous Integration with no Downtime in AWS
+ + =
www.ackstorm.es
Docker es infraestructura
como código
Docker es Container como
servicio
www.ackstorm.es
It’s not rocket science
www.ackstorm.es
13
Docker is CaaS and IaaC
- IaaC
- CaaS
- Repetitive environments
www.ackstorm.es
Bring a fix from branch n to branch m require m-n merges Perform merges the early and frequently as possible.
14
Mainline pattern
Git Mainline Pattern
www.ackstorm.es
You just developed a stable version of the software and you need to create a new version with new features and still provide small fixes for the last stable version.
Branches will are PRE and PRO
15
Git Branches
www.ackstorm.es
MASTER
PRE
PROD
N
N + 1
Git simple stages
www.ackstorm.es
Jenkins configuration
www.ackstorm.es
www.ackstorm.es
1) Authenticate your Docker client to your registry:
aws ecr get-login --region eu-west-1
2) Run the docker login command that was returned in the previous step.
3) Build your Docker image:
docker build -t aws-demo .
4) After the build completes, tag your image and push the image to this repository:
docker tag aws-demo:latest 638514630763.dkr.ecr.eu-west-1.amazonaws.com/aws-demo:
latest
5) Push this image to your newly created AWS repository:
docker push 638514630763.dkr.ecr.eu-west-1.amazonaws.com/aws-demo:latest
AWS Docker Registry
www.ackstorm.es
HAPROXY configuration
www.ackstorm.es
DEPLOYNew version on BLUE
WAIT PENDING REQ.Momento BLUE / GREEN
PRODUCTIONMomento GREEN
DEPLOYNew version on GREEN
Version 2 Version 2 Version 2
Version 2
GRACEFUL STOP
HAPROXY Conf
www.ackstorm.es
¡Gracias por vuestra atención!Thank You
Fin
top related