SlideShare a Scribd company logo
Container-Based Microservice Architecture
M A K I N G D R E A M W E D D I N G S P O S S I B L E
Docker ID Meetup - Jakarta, 28 March 2018
ADITYA HILMAN
M A K I N G D R E A M W E D D I N G S P O S S I B L E
ABOUT ME
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
PROFESSIONAL
● Linux System Consultant, Indolinux (2008 - 2011)
● Senior System Administrator, FirstWAP (2011-2014)
● System Architect Engineer, Bridestory (2014-now)
CONTACT
● Personal Email : aditya.hilman@gmail.com
● Business Email : aditya.hilman@bridestory.com
● Linkedin : http://bit.ly/adityahilman
WHAT IS
BRIDESTORY?
M A K I N G D R E A M W E D D I N G S P O S S I B L E
WHAT IS BRIDESTORY
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
OUR VISION
M A K I N G D R E A M W E D D I N G S P O S S I B L E
OUR VISION
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
TO HELP CREATE DREAM WEDDINGS POSSIBLE FOR
EVERYONE, EVERYWHERE
OUR MISSION
M A K I N G D R E A M W E D D I N G S P O S S I B L E
OUR MISSION
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
TO BECOME THE MOST POWERFUL TOOL FOR
BRIDES-TO-BE AROUND THE WORLD THAT ENABLES
THEM TO:
FIND MILLION OF
WEDDING
INSPIRATIONS
FIND THE BEST
WEDDING VENDORS
ANYWHERE
BOOK THEIR SERVICE
THROUGH OUR WEDDING
CONSULTANT SERVICE
BRIDESTORY IN
NUMBERS
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY IN NUMBERS
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
*according to Similar Web, since August 2015
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
CONTAINER-BASED
MICROSERVICE ARCHITECTURE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
DISCLAIMER
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Emphasis on infrastructure and deployment point of view, not on application or
software development point of view
MONOLITHIC
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Pros :
● Simple infra architecture
● Easy to troubleshoot
Cons :
● Slow iteration: small change requires full
deployment
● Difficult to isolate application services
● Difficult to deploy
● Difficult to scale
From infrastructure point of view
MONOLITHIC BIG PROBLEM
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
v1.0 v2.0 v2.1
Local Staging Production
DOCKERIZE ARCHITECTURE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Pros :
● Isolate
● Easy deployment
Cons :
● Difficult to scale
MONOLITHIC vs MICROSERVICE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
MONOLITHIC vs MICROSERVICE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
MICROSERVICE ARCHITECTURE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Pros :
● Easy to scale
● Infra cost effective (start with 1 instance)
Cons :
● More complex deployment pipeline
● Challenging in Logging, need to build
Centralized Logging
From infrastructure point of view
AWS ELASTIC CONTAINER SERVICE (ECS)
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
ECS COMPONENTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
IMPLEMENTATION
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● URL Application Health Check
○ /microservice/healthcheck (Custom Url)
● Application Load Balancer
○ Distribute traffic to container
● Task Definition
○ Group of container
● Cluster
○ Group of services
● Service
○ Group of tasks
TASK DEFINITION
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● Docker image for each container
● CPU and Memory requirement for each container
● Links between containers
● Networking and port settings
● Log settings
SERVICES
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● Manage long-running workloads
● Monitor running tasks
● Restart tasks if they fail
Application Load Balancer-Based Service Discovery
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● Service health checks
● Automatic registration/de-registration services
● Path and Host based routing
SECURING ECS CLUSTER
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY ARCHITECTURE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
ECS DEPLOYMENT
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
DEPLOYMENT PIPELINE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● Checkout Repo
● Build & Tag Docker Image
● Container Testing
● Push Docker Image to ECR
● Create New Task
● Update Service Cluster
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Stage : Build & Docker Image
sh 'docker build -f dockerfile-staging -t microservice-app:staging-${BUILD_NUMBER} .'
● Different dockerfile for staging and production
● Tag ${BUILD_NUMBER} => Jenkins Env Variable
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Stage : Container Testing
sh './container-testing.bash'
docker run --rm --name ms-staging -d -P microservice-app:staging-${BUILD_NUMBER}
MS_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' ms-staging`
sleep 30s
RESPONSE_CODE=`curl -I -X GET http://$MS_IP/v2/endpoint | head -n1 | awk '{ print $2 }'`
if [ $RESPONSE_CODE != "200" ]
then
echo "Tests Failed! - Return code $RESPONSE_CODE"
echo "Remove ms-staging container"
docker stop ms-staging
exit 1
else
echo "Tests Passed"
echo "Remove ms-staging container"
docker stop ms-staging
exit 0
fi
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Stage : Create New Task
sh 'sed -e "s:BUILD_NUMBER:${BUILD_NUMBER}:g"
task-template/staging/microservice-app.json > microservice-app-${BUILD_NUMBER}.json'
sh 'aws ecs register-task-definition --family microservice-staging-task --cli-input-json
file://microservice-app-${BUILD_NUMBER}.json'
● Tag ${BUILD_NUMBER} => Jenkins Env Variable
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Task Template
{
"containerDefinitions": [
{
"portMappings": [
{
"hostPort": 0,
"containerPort": 3000,
"protocol": "tcp"
}
],
"essential": true,
"name": "chat-staging-container",
"image": "xxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/chat-web:staging-BUILD_NUMBER",
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "cluster-staging",
"awslogs-region": "ap-southeast-1",
"awslogs-stream-prefix": "chat-staging"
}
},
"cpu": 0,
"memoryReservation": 128
}
],
"family": "chat-staging-task"
}
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Stage : Update Service Cluster
#!/bin/bash
TASK_REVISION=`aws ecs describe-task-definition --task-definition
microservice-staging-task | egrep "revision" | tr "/" " " | awk '{ print $2 }' | sed
's/,$//'`
DESIRED_COUNT=`aws ecs describe-services --services
arn:aws:ecs:ap-southeast-1:xxxxxxx:service/microservice-staging-service --cluster
arn:aws:ecs:ap-southeast-1:xxxxxxx:cluster/microservice-staging-cluster-private | egrep
"desiredCount" | tr "/" " " | awk '{print $2}' | sed 's/,$//' | head -n1`
if [ ${DESIRED_COUNT} = "0" ]; then
DESIRED_COUNT="1"
fi
aws ecs update-service --cluster
arn:aws:ecs:ap-southeast-1:xxxxxxx:cluster/microservice-staging-cluster-private
--service arn:aws:ecs:ap-southeast-1:xxxxxxx:service/microservice-staging-service
--task-definition microservice-staging-task:${TASK_REVISION} --desired-count
${DESIRED_COUNT}
MONITORING
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
MONITORING & ALERTING
● GRAFANA
● GOOGLE STACK DRIVER
● TELEGRAM
● EMAIL
CENTRALIZED LOGGING
● CLOUDWATCH LOGS
● ELK STACK
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
GRAFANA
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
TELEGRAM
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Q & A
M A K I N G D R E A M W E D D I N G S P O S S I B L E
Q & A
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.

More Related Content

PDF
Lesson learned from React native and Flutter
PDF
RobotFramework Meetup at Thailand #2
PDF
Visual testing
PDF
SiriusCon 2017 - Document Generation with M2Doc
PDF
Productivity Engineering: Surviving DevOps
PDF
Next of Java 2022
PDF
CILogon 2.0 at 2016 Internet2 Global Summit
PPTX
Modern Authentication for ASP.NET Core with IdentityServer 4 (Progressive .NE...
Lesson learned from React native and Flutter
RobotFramework Meetup at Thailand #2
Visual testing
SiriusCon 2017 - Document Generation with M2Doc
Productivity Engineering: Surviving DevOps
Next of Java 2022
CILogon 2.0 at 2016 Internet2 Global Summit
Modern Authentication for ASP.NET Core with IdentityServer 4 (Progressive .NE...

Similar to Container-Based Microservice Architecture (20)

PDF
More Containers Less Operations
PDF
Why Your Digital Transformation Strategy Demands Middleware Modernization
PPTX
Microservices in the Enterprise
PDF
Dockercon State of the Art in Microservices
PPTX
DevOps 101+: From collaboration to microservices
PDF
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
PPTX
PHP Symfony MicroServices Migration @MeeticTech
PPT
Integration in the Cloud
PDF
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
PDF
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
PPTX
Webinar : Microservices and Containerization
PDF
Winter is Coming for Microservice Complexity - Challenges with Docker Apps
PPTX
Microservices and containers for the unitiated
PDF
Merging micrservices architecture with SOA Practices
PDF
Microservice architecture
PDF
Microservices: State of the Union
PDF
Customer story - Why Containers by Sameer Kumar
PPTX
Accelerate DevOps/Microservices and Kubernetes
PDF
DCEU 18: How To Build Your Containerization Strategy
PPTX
Blue Whale in an Enterprise Pond
More Containers Less Operations
Why Your Digital Transformation Strategy Demands Middleware Modernization
Microservices in the Enterprise
Dockercon State of the Art in Microservices
DevOps 101+: From collaboration to microservices
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
PHP Symfony MicroServices Migration @MeeticTech
Integration in the Cloud
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
Webinar : Microservices and Containerization
Winter is Coming for Microservice Complexity - Challenges with Docker Apps
Microservices and containers for the unitiated
Merging micrservices architecture with SOA Practices
Microservice architecture
Microservices: State of the Union
Customer story - Why Containers by Sameer Kumar
Accelerate DevOps/Microservices and Kubernetes
DCEU 18: How To Build Your Containerization Strategy
Blue Whale in an Enterprise Pond
Ad

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
Teaching material agriculture food technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
cuic standard and advanced reporting.pdf
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
Big Data Technologies - Introduction.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Machine learning based COVID-19 study performance prediction
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The AUB Centre for AI in Media Proposal.docx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Building Integrated photovoltaic BIPV_UPV.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
Teaching material agriculture food technology
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
cuic standard and advanced reporting.pdf
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
Ad

Container-Based Microservice Architecture

  • 1. Container-Based Microservice Architecture M A K I N G D R E A M W E D D I N G S P O S S I B L E Docker ID Meetup - Jakarta, 28 March 2018
  • 2. ADITYA HILMAN M A K I N G D R E A M W E D D I N G S P O S S I B L E ABOUT ME © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. PROFESSIONAL ● Linux System Consultant, Indolinux (2008 - 2011) ● Senior System Administrator, FirstWAP (2011-2014) ● System Architect Engineer, Bridestory (2014-now) CONTACT ● Personal Email : aditya.hilman@gmail.com ● Business Email : aditya.hilman@bridestory.com ● Linkedin : http://bit.ly/adityahilman
  • 3. WHAT IS BRIDESTORY? M A K I N G D R E A M W E D D I N G S P O S S I B L E WHAT IS BRIDESTORY © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 4. OUR VISION M A K I N G D R E A M W E D D I N G S P O S S I B L E OUR VISION © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. TO HELP CREATE DREAM WEDDINGS POSSIBLE FOR EVERYONE, EVERYWHERE
  • 5. OUR MISSION M A K I N G D R E A M W E D D I N G S P O S S I B L E OUR MISSION © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. TO BECOME THE MOST POWERFUL TOOL FOR BRIDES-TO-BE AROUND THE WORLD THAT ENABLES THEM TO: FIND MILLION OF WEDDING INSPIRATIONS FIND THE BEST WEDDING VENDORS ANYWHERE BOOK THEIR SERVICE THROUGH OUR WEDDING CONSULTANT SERVICE
  • 6. BRIDESTORY IN NUMBERS M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY IN NUMBERS © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. *according to Similar Web, since August 2015
  • 7. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 8. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 9. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 10. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 11. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 12. CONTAINER-BASED MICROSERVICE ARCHITECTURE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 13. DISCLAIMER M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Emphasis on infrastructure and deployment point of view, not on application or software development point of view
  • 14. MONOLITHIC M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Pros : ● Simple infra architecture ● Easy to troubleshoot Cons : ● Slow iteration: small change requires full deployment ● Difficult to isolate application services ● Difficult to deploy ● Difficult to scale From infrastructure point of view
  • 15. MONOLITHIC BIG PROBLEM M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. v1.0 v2.0 v2.1 Local Staging Production
  • 16. DOCKERIZE ARCHITECTURE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Pros : ● Isolate ● Easy deployment Cons : ● Difficult to scale
  • 17. MONOLITHIC vs MICROSERVICE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 18. MONOLITHIC vs MICROSERVICE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 19. MICROSERVICE ARCHITECTURE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Pros : ● Easy to scale ● Infra cost effective (start with 1 instance) Cons : ● More complex deployment pipeline ● Challenging in Logging, need to build Centralized Logging From infrastructure point of view
  • 20. AWS ELASTIC CONTAINER SERVICE (ECS) M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 21. ECS COMPONENTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 22. IMPLEMENTATION M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● URL Application Health Check ○ /microservice/healthcheck (Custom Url) ● Application Load Balancer ○ Distribute traffic to container ● Task Definition ○ Group of container ● Cluster ○ Group of services ● Service ○ Group of tasks
  • 23. TASK DEFINITION M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● Docker image for each container ● CPU and Memory requirement for each container ● Links between containers ● Networking and port settings ● Log settings
  • 24. SERVICES M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● Manage long-running workloads ● Monitor running tasks ● Restart tasks if they fail
  • 25. Application Load Balancer-Based Service Discovery M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● Service health checks ● Automatic registration/de-registration services ● Path and Host based routing
  • 26. SECURING ECS CLUSTER M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 27. BRIDESTORY ARCHITECTURE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 28. ECS DEPLOYMENT M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 29. DEPLOYMENT PIPELINE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● Checkout Repo ● Build & Tag Docker Image ● Container Testing ● Push Docker Image to ECR ● Create New Task ● Update Service Cluster
  • 30. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 31. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Stage : Build & Docker Image sh 'docker build -f dockerfile-staging -t microservice-app:staging-${BUILD_NUMBER} .' ● Different dockerfile for staging and production ● Tag ${BUILD_NUMBER} => Jenkins Env Variable
  • 32. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Stage : Container Testing sh './container-testing.bash' docker run --rm --name ms-staging -d -P microservice-app:staging-${BUILD_NUMBER} MS_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' ms-staging` sleep 30s RESPONSE_CODE=`curl -I -X GET http://$MS_IP/v2/endpoint | head -n1 | awk '{ print $2 }'` if [ $RESPONSE_CODE != "200" ] then echo "Tests Failed! - Return code $RESPONSE_CODE" echo "Remove ms-staging container" docker stop ms-staging exit 1 else echo "Tests Passed" echo "Remove ms-staging container" docker stop ms-staging exit 0 fi
  • 33. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Stage : Create New Task sh 'sed -e "s:BUILD_NUMBER:${BUILD_NUMBER}:g" task-template/staging/microservice-app.json > microservice-app-${BUILD_NUMBER}.json' sh 'aws ecs register-task-definition --family microservice-staging-task --cli-input-json file://microservice-app-${BUILD_NUMBER}.json' ● Tag ${BUILD_NUMBER} => Jenkins Env Variable
  • 34. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Task Template { "containerDefinitions": [ { "portMappings": [ { "hostPort": 0, "containerPort": 3000, "protocol": "tcp" } ], "essential": true, "name": "chat-staging-container", "image": "xxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/chat-web:staging-BUILD_NUMBER", "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "cluster-staging", "awslogs-region": "ap-southeast-1", "awslogs-stream-prefix": "chat-staging" } }, "cpu": 0, "memoryReservation": 128 } ], "family": "chat-staging-task" }
  • 35. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Stage : Update Service Cluster #!/bin/bash TASK_REVISION=`aws ecs describe-task-definition --task-definition microservice-staging-task | egrep "revision" | tr "/" " " | awk '{ print $2 }' | sed 's/,$//'` DESIRED_COUNT=`aws ecs describe-services --services arn:aws:ecs:ap-southeast-1:xxxxxxx:service/microservice-staging-service --cluster arn:aws:ecs:ap-southeast-1:xxxxxxx:cluster/microservice-staging-cluster-private | egrep "desiredCount" | tr "/" " " | awk '{print $2}' | sed 's/,$//' | head -n1` if [ ${DESIRED_COUNT} = "0" ]; then DESIRED_COUNT="1" fi aws ecs update-service --cluster arn:aws:ecs:ap-southeast-1:xxxxxxx:cluster/microservice-staging-cluster-private --service arn:aws:ecs:ap-southeast-1:xxxxxxx:service/microservice-staging-service --task-definition microservice-staging-task:${TASK_REVISION} --desired-count ${DESIRED_COUNT}
  • 36. MONITORING M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 37. MONITORING & ALERTING ● GRAFANA ● GOOGLE STACK DRIVER ● TELEGRAM ● EMAIL CENTRALIZED LOGGING ● CLOUDWATCH LOGS ● ELK STACK M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 38. GRAFANA M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 39. TELEGRAM M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 40. Q & A M A K I N G D R E A M W E D D I N G S P O S S I B L E Q & A © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.