The last couple of years the technology of containerization via Docker has gained incredible popularity. Many teams already successfully use infrastructure services, staging, testbed in containers, but many people are afraid of using containers to deploy applications in production. The community still lacks success-stories, especially for applications without microservice architecture. The huge number of approaches and recipes does not as well add confidence in what you are doing.
This report is about our fears, successes and solutions for the dockerization of the classical monolith in production..
8. • Quick Start
• Instant Visibility
• Logs + Metrics + Alerts
• Backups
• Underlying infrastructure as a service
• No need Support for infrastructure
Что мы любим
в Heroku
10. Heroku Docker AWS
3 workers x 25$
DB 75$
Logentries 7$
2 Sidekiq x 25$
Redis 200$
407$
3 workers x 9$
DB 29$
CloudWatch 0$
3 Sidekiq x 0$
Redis 25$
63$
VS
20. • Простое управление кластерами в любом масштабе
• Расширяемость
• Безопасность
• Использование с другими сервисами AWS
• Autoscaling, CloudFormation Cluster
• Docker-compose compatibility
• Rollback & Container soft placement
• Интеграция с ECS практически в любом облачном сборщике
Управление
контейнерами
Elastic Container
Service
21. • Гибкость и декларативность
• Инфраструктура в виде кода
• Настройка с помощью параметров
• Поддерживает широкий перечень ресурсов AWS
• Позволяет поддерживать кластер в работоспособном
состоянии перезапуская / переподнимая дефектную машину
Кластер на
CloudFormation
27. ECS Cluster node
1 Service
Number
of desired nodes = 2
Number of nodes = 1
Docker is dead
ECS Cluster node
0 Service
28. ECS Cluster node
1 Service
Number
of desired nodes = 2
Number of nodes = 2
ECS Cluster node
1 Service
Docker is dead
29. • Data insecurity
• Specific resource requirements
• Network problems
• State in computing environment
• They just don’t fit major Docker features
• Extra isolation is critical at the database layer
• Cloud platform incompatibility
Stateful in
containers
30. 1. Database
2. Key-Value storage
3. Logs
4. Uploads
Stateful in containers is dangerous
What we’ve put in containers
Dev or Ops
Environment
Database
CI/CD Server
Web Server
Api Server
Batch Jobs
Integration
Stateless
Stateful
Long - Life Short - Life
31. 1. Database → RDS
2. Key-Value storage → Elasticache
3. Logs → CloudWatch
4. Uploads → S3
Stateful in containers is dangerous
What we’ve put in containers
Dev or Ops
Environment
Database
CI/CD Server
Web Server
Api Server
Batch Jobs
Integration
Stateless
Stateful
Long - Life Short - Life
38. CloudWatch
• 0$
• No time limits for log storage
• Have access to each AWS Recourse
• Quick start
39. 1. 5 environments
2. 0 fuck ups with AWS ECS
3. ~15 zero-downtime deployments per-day
4. ~400$ per-month for all environments
What we have?
40. • Don’t put data in Docker
• Put docker in auto scaling groups
• Have 2 instances of everything
• Reboot containers in case of close to quotes
• Keep your images slim for fast scaling and healing
Simple receipt