Top Banner
Elasticbeanstalk @derya_sezen DevOps Consultant / kloia
24

AWS ElasticBeanstalk and Docker

Feb 08, 2017

Download

Software

kloia
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: AWS ElasticBeanstalk and Docker

Elasticbeanstalk@derya_sezen

DevOps Consultant / kloia

Page 2: AWS ElasticBeanstalk and Docker

DevOps CloudMicro Services

hands-on-labs

Page 3: AWS ElasticBeanstalk and Docker

ELASTICBEANSTALK - paas Platform-as-a-Service

Page 4: AWS ElasticBeanstalk and Docker

ELASTICBEANSTALK

Page 5: AWS ElasticBeanstalk and Docker

ELASTICBEANSTALK-languages

Page 6: AWS ElasticBeanstalk and Docker

● Deployment artifacts: zip, war, docker

● Competitors: Heroku, Azure Web Sites, Cloud Foundry, Bluemix, Google

App Engine, Openshift

ELASTICBEANSTALK

Page 7: AWS ElasticBeanstalk and Docker

● Architecture:○ app vs. env○ Each env has a CNAME pointing ELB○ URL is Route53 aliased○ Host Manager (HM) runs on each EC2○ HM is responsible for:

■ deploy app■ aggregate events&metrics for API, console■ generate events■ monitoring app log files&app server■ rotate log files and s3 publish

ELASTICBEANSTALK

Page 8: AWS ElasticBeanstalk and Docker

○ ElasticBeanstalk calls the AWS services using this role on your behalf

○ EC2, SQS, ELB, AutoScaling...

○ Environment tiers:

■ Webtier: Website, API

■ Workertier: Long running jobs, consumers

■ Docker: SingleContainer & MultiContainer

ELASTICBEANSTALK-tiers

Page 9: AWS ElasticBeanstalk and Docker

○ Worker env:■ sqsd■ http://localhost:80/<httppath>■ custom httppath■ web application should only listen to

localhost■ web application returns 200 to inform that

message is processed, sqsd send a delete message to queue

ELASTICBEANSTALK-worker

Page 10: AWS ElasticBeanstalk and Docker

ELASTICBEANSTALK-hooksHook preinit deploy/pre deploy/enact deploy/post postinit

Deploy instance ✅ ✅ ✅ ✅ ✅

Deploy version ✅ ✅ ✅

Hook pre enact post

Change env. ✅ ✅ ✅

Restart App Server ✅ ✅ ✅

Page 11: AWS ElasticBeanstalk and Docker

○ Periodic tasks:

■ cron expression

■ cron.yaml file in the root of the project

● Version controlled!!

● “rebuild all from code” principle

version: 1cron: - name: "backup-job" # required - unique across all entries in this file url: "/backup" # required - does not need to be unique schedule: "0 */12 * * *" # required - does not need to be unique - name: "audit" url: "/audit" schedule: "0 23 * * *"

ELASTICBEANSTALK-cron

Page 12: AWS ElasticBeanstalk and Docker

○ Configuration:■ Language specific

● Java,Docker: Environment Variable● .NET: web.config● Php: environment.ini● ...

■ 12Factor compliant?

ELASTICBEANSTALK-configuration

Page 13: AWS ElasticBeanstalk and Docker

○ Artifact:■ S3■ Versioning

ELASTICBEANSTALK-versioning

Page 14: AWS ElasticBeanstalk and Docker

ELASTICBEANSTALK-deploy

Page 15: AWS ElasticBeanstalk and Docker

○ Scaling:■ Akordion■ AWS AutoScaling■ On Single/Multi Docker, EC2 based, not container!

ELASTICBEANSTALK-scaling

Page 16: AWS ElasticBeanstalk and Docker

docker● “Industry 3.0” of Software Development

● “Infrastructure-as-code” DevOps Practice

● Infra Cost Optimisation(Storage/VM)

● Binary/Byte + Hosting/OS Dependencies

● Identical dev-test-staging-prod...

Page 17: AWS ElasticBeanstalk and Docker

docker-Dev. Env.- “Local” Development Environment

- Lightweight vs. Vagrant

- Local vs. Prod identical

- “Infra-as-code” DevOps practice

Page 18: AWS ElasticBeanstalk and Docker

docker-dockerfileDockerfile Image

Page 19: AWS ElasticBeanstalk and Docker

docker-architecture

Page 20: AWS ElasticBeanstalk and Docker

docker-Dev. Env.Dockerfile initiatives:

● FROM

● COPY/ADD

● RUN

● CMD/ENTRYPOINT

Page 21: AWS ElasticBeanstalk and Docker

Docker-docker compose

Page 22: AWS ElasticBeanstalk and Docker

Docker-docker machine

Page 23: AWS ElasticBeanstalk and Docker

Docker 1.12● Swarm-mode: Orchestration built-in,

Infra-agnostic

● Cryptographic Node Security: Mutual TLS, Key

rotation, Notary & TUF

● Routing Mesh: Service Discovery, Container

native load-balancing, Works with current LB,

IPVS

Page 24: AWS ElasticBeanstalk and Docker

Questions?https://github.com/kloia/elasticbeanstalk

@derya_sezenDevOps Consultant / kloia