Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Micro services infrastructure
With Ansible and AWS
Bamdad Dashtban
@bamdad
ScienceDirect.com Story
Legacy code
● C++ monolithic legacy code.
● Not fast enough response time.
● Maintenance was hard and expensive.
● Develop...
New stack
● Faster delivery of features using CD.
● Improve performance.
● Make it exciting stack to work with.
● Scalable...
Strangler Pattern
User
Router
Apps
Micro services
● Scalable
● Micro services in front of the current stack.
● Caching.
● Adding new features.
● Shape teams ...
Cloud
● AWS
○ Phoenix Pattern (immutable servers)
○ DNS for semantic versioning
○ VPC networking ( public and private )
○ ...
Ansible
● Provisioning
● Deployment
Amazon EC2
Instance AMI
● Automatic Trigger
● RPM build
● Yum update on 1 instance
Deployment Iteration 0
Deployment Iteration 1
● RPM build
● Manual Trigger
● Bake AMI with RPM
● New ASG with ELB
AMI
Deployment Iteration 2
● Automatic Trigger
● RPM pull with user-data
● New ASG with ELB
AMI
user-data
executable script
Deployment Iteration 3
● Automatic Trigger
● RPM pull with user-data
● reuse of the ELBs
AMI
user-data
executable script
Continuous Delivery
● Jenkins to GoCD.
● Pipelines instead of Tasks.
● Concept of Environments.
● Environment Specific Age...
Problems
● Complexity
● Service Discovery.
● ELB resizing.
● CDN routing.
● Deployment Time.
● Ansible Changes.
● Cost.
Complexity
App
Request Request
Method Call
HTTP
Request
Service Discovery
V n-2
V n-1
V n
V n -1
V n
?
App 1 App 2
Service Discovery
● We are not currently using service discovery tools.
● Predictable DNS endpoints.
● Amazon Route53 Alia...
ELB resizing
ELB
App
ELB
App
ELB
CDN Routing
● Routing based on files on a network file system.
(Slow)
● Slow on making configuration changes to CDN.
Deployment Time
● Bake AMI (15-25 mins)
● Deploy (1-2 mins)
● Smoke Test (2-4 mins for DNS)
● Service Test (1 min)
● Switc...
Ansible
● Started with ansible 1.7
● pulled some changes from 1.8
● Patched some modules
● Ansible splitted Modules to a s...
Question?
Thanks
● ThoughtWorks and Elsevier are both both hiring.
● Feel free to come and talk to us.
@bamdad
Nächste SlideShare
Wird geladen in …5
×

Micro services infrastructure with AWS and Ansible

2.485 Aufrufe

Veröffentlicht am

Micro services infrastructure with AWS and ansible

Veröffentlicht in: Technologie

Micro services infrastructure with AWS and Ansible

  1. 1. Micro services infrastructure With Ansible and AWS Bamdad Dashtban @bamdad
  2. 2. ScienceDirect.com Story
  3. 3. Legacy code ● C++ monolithic legacy code. ● Not fast enough response time. ● Maintenance was hard and expensive. ● Development of new features was hard. ● Wasn’t Multi region. ● Not so exciting stack.
  4. 4. New stack ● Faster delivery of features using CD. ● Improve performance. ● Make it exciting stack to work with. ● Scalable for higher load.
  5. 5. Strangler Pattern User Router Apps
  6. 6. Micro services ● Scalable ● Micro services in front of the current stack. ● Caching. ● Adding new features. ● Shape teams based on the MicroServices.
  7. 7. Cloud ● AWS ○ Phoenix Pattern (immutable servers) ○ DNS for semantic versioning ○ VPC networking ( public and private ) ○ ELB ○ Autoscaling
  8. 8. Ansible ● Provisioning ● Deployment Amazon EC2 Instance AMI
  9. 9. ● Automatic Trigger ● RPM build ● Yum update on 1 instance Deployment Iteration 0
  10. 10. Deployment Iteration 1 ● RPM build ● Manual Trigger ● Bake AMI with RPM ● New ASG with ELB AMI
  11. 11. Deployment Iteration 2 ● Automatic Trigger ● RPM pull with user-data ● New ASG with ELB AMI user-data executable script
  12. 12. Deployment Iteration 3 ● Automatic Trigger ● RPM pull with user-data ● reuse of the ELBs AMI user-data executable script
  13. 13. Continuous Delivery ● Jenkins to GoCD. ● Pipelines instead of Tasks. ● Concept of Environments. ● Environment Specific Agents. ● Resource Specific Agents.
  14. 14. Problems ● Complexity ● Service Discovery. ● ELB resizing. ● CDN routing. ● Deployment Time. ● Ansible Changes. ● Cost.
  15. 15. Complexity App Request Request Method Call HTTP Request
  16. 16. Service Discovery V n-2 V n-1 V n V n -1 V n ? App 1 App 2
  17. 17. Service Discovery ● We are not currently using service discovery tools. ● Predictable DNS endpoints. ● Amazon Route53 Aliases instead of CNAMEs. ● Looking at other solutions like Consul, etcd, Mesos DNS
  18. 18. ELB resizing ELB App ELB App ELB
  19. 19. CDN Routing ● Routing based on files on a network file system. (Slow) ● Slow on making configuration changes to CDN.
  20. 20. Deployment Time ● Bake AMI (15-25 mins) ● Deploy (1-2 mins) ● Smoke Test (2-4 mins for DNS) ● Service Test (1 min) ● Switch (1 min) ● Get rid of old instances. (1 min) (repeat [“Dev” “QA” “Perf” “Stage” “Prod”])
  21. 21. Ansible ● Started with ansible 1.7 ● pulled some changes from 1.8 ● Patched some modules ● Ansible splitted Modules to a separate repo. ● Our pull requests have not got accepted.
  22. 22. Question?
  23. 23. Thanks ● ThoughtWorks and Elsevier are both both hiring. ● Feel free to come and talk to us. @bamdad

×