Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Config management 2.0

Senthil V S
January 22, 2019

Config management 2.0

The whole `DevOps` movement is about no separate `Dev` and `Ops` teams. But with using heavy config management tools, we're once again on the same place just that we've replaced bash scripts with yamls and central store. For a startup, this approach does not suit. We've taken a different approach and finding it fruitful. In this talk, we will share our journey and why our approach could be useful to you.

Senthil V S

January 22, 2019
Tweet

More Decks by Senthil V S

Other Decks in Technology

Transcript

  1. make money simple, so that people can live well and

    do amazing things. API SDKs Mobile and web apps
  2. Simpl architecture Services Streaming Platform Data Pipeline Dashboards Analytics ML

    models Merchant Apps Simpl Website ML models feed back underwriting, UX decisions, etc services Event sourcing Kafka as streaming platform services
  3. Hard challenges vs less resources >100 merchants checkout 
 page

    90k req/min ~20 μservices Four tech stacks 
 (RoR, GoLang, Node, Python) >200GB of event data/day Continuous delivery Strict security needs Five developers. No DevOps No BW to manage Kubernetes AWS had only ECS then
  4. Typical codebase Service A Service B Service C DevOps code

    Library X • Services could be polyglot • Developers own services • DevOps code by DevOps person • Puppet/Chef/Ansible
  5. DevOps: Dissection Service A Service B Service C Library X

    
 DevOps code Service topography Environ. config Deployment Observability Provisioning Network } } • Service specific • Frequent changes • Common across services • Changes less • Platform dependent
  6. DevOps: Service topography Service A Service B Service C Library

    X Dockerfile JSON store • As JSON config • Managed by developers at central store 
 DevOps code Service topography Environ. config Deployment Observability Provisioning Network
  7. DevOps: Env. config Service A Service B Service C Library

    X Dockerfile JSON store env.sample & parameter store • Secure central storage • Versioned file <> Central store 
 DevOps code Service topography Environ. config Deployment Observability Provisioning Network
  8. DevOps: Summary Service A Service B Service C Library X

    Dockerfile JSON store env.sample & parameter store } • AWS APIs • JSON store • AWS VPCs & ECS • Cloudformation & APIs 
 DevOps code Service topography Environ. config Deployment Observability Provisioning Network
  9. Cloudlift Service A Service B Service C Library X Service

    topography Environ. config Observability Network Provisioning Deployment • Glues above and creates cloudformation templates • executable as CLI • Python • In production for 2 years • Open sourced. 
 https://github.com/GetSimpl/cloudlift Cloudlift
  10. Demo: Create service • Service config by user • cfn

    template building with trophosphere • Api call to AWS • dynamoDB as service config store Service Config cloudlift Cloudformation template
  11. Demo: Create service • One repo, multiple services • http

    interface or background • Internal (visible at VPC level) vs public • Stored in AWS dynamoDB
  12. Demo: Edit environment config • Git commit like editor flow

    to change config • Stored in AWS parameter store, encrypted
  13. Demo: deploy service Push local docker 
 image to ECR

    Ensure store has all required config env.sample Docker registry ECR Parameter store Update the task definition with image version & env vars ECS runs new containers with updated version Stops the old version once new are up ★ The service name is guessed from current dir ★ image name is same as repo name ★ latest version is picked to push 1 2 3 4 5
  14. AWS Lambda Logs • 12-factor: Logs as event streams •

    Structured log to STDOUT • AWS lambda pipe • Searchable log viewer CloudWatch logs STDOUT logs
  15. Microservices & DevOps Build-time dependency ▶ Library Run-time dependency ▶

    Another microservice Lifecycle dependency ▶ DevOps
  16. How to add features to cloudlift? Service A Cloudlift Do

    it microservices style v1 Service B v1 Service C v1 v1 Service A Cloudlift v1 Service B v1 Service C v1 v2 Service A Cloudlift v1 Service B v2 Service C v1 v2 Service A, B, C are running with cloudlift version v1 Feature gets added to Cloudlift 
 
 New version released Service uses new feature
 
 Cloudlift is backward compatible
  17. 12 factor apps - Env var config - Port binding

    - Dev/prod parity - Logs as event streams
  18. Prefer CLI over GUI - Building CLI is easier -

    Easier to integrate in CI tools - Security