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

How the hell do I run my microservices in production, and will it scale?

How the hell do I run my microservices in production, and will it scale?

by Daniel van Gils
DevOps Pro Vilnius 2016

DevOps Pro

June 01, 2016
Tweet

More Decks by DevOps Pro

Other Decks in Technology

Transcript

  1. Established in 2012 Build, deploy and maintain any application on

    any server, on the cloud provider of your choice or bring your own servers. Running Docker in production for almost 1½ years for our customers. We simplify DevOps. Average of 4000+ servers.
  2. How the hell do I run Docker in Production?... and

    will it scale? Daniël van Gils @foldingbeauty [email protected] www.cloud66.com
  3. NOISE $docker run alpine echo 'hello world’ you don’t know

    what kind of skills you need production you know what kind of skill you need you think you know your gained all the skills but you don’t know time skills
  4. Ɨ Ȑ Ȑ containers Ɨ ƗƗ Ɨ Ɨ Ɨ Ɨ

    bin/libs os bin/libs bin/libs Ǹ Ȑ server os bin/libs Ǹ Ȑ Ȑ cloud/VM os bin/libs Ǹ Ȑ os bin/libs
  5. service Ɨ containers server cluster(s) Ȑ image Ɨ ǽ Ɨ

    Ɨ = code = docker file = docker engine = platform Ɨ build ship deploy
  6. Keep Images Slim Stupid dev » test » stage »

    production ǽ Minimal Lovable Service Image
  7. SMALL SECURE SPEEDY / PERFORMANT STABLE
 SET / IMMUTABLE Ɨ

    ǽ Keep Images Small, Secure, Speedy, Stable and Set Stupid
  8. SMALL Start with the smallest minimal image you can find.

    Remove compile time dependencies. Remove packages you don’t need. Run stats for the image. Ɨ ǽ “I didn't have time to create a slim image, so I created a fat one instead.”
  9. SECURE Remove all the secrets. Patch to the latest security

    updates. Run the image with the right UID. Test the image. Ɨ ǽ
  10. STABLE Lock the image version. Lock the runtime version(s). Tag

    your image. Proper logging. Image guideline for your team. Ɨ ǽ
  11. IMMUTABLE Use volumes wisely. Loosely coupled. Don’t use databases inside

    a image. Use external services for persistency. Ɨ ǽ
  12. dev » test » stage » production ǽ Minimal Lovable

    Service Image Keep Images Small, Secure, Speedy, Stable and Set Stupid
  13. Ɨ ǽ Ɨ  API first containerisation ± 20% Ɨ

    ǽ Ɨapi 1x frontend 1x image frontend FAT image api FAT
  14. Ɨ ǽ Ɨ  splitting monolith containerisation ± 6% Ɨ

    ǽ api 6x frontend 1x Ɨ ǽ Ɨ workers 10x ƗƗ Ɨ ƗƗƗ Ɨ ƗƗ image frontend FAT image api THIN image workers THIN ƗƗƗ ƗƗ Ɨ
  15. Ɨ ǽ Ɨ ǽ A 6x B 12x Ɨ ǽ

    Ɨ C 10x ƗƗ Ɨ ƗƗƗ Ɨ ƗƗ image B THIN image A THIN image C THIN ƗƗƗ ƗƗ Ɨ microservice architecture ± 4% ƗƗƗ ƗƗ ƗƗ Ɨ Ɨ ƗƗ Ɨ  message queue
  16. DEV/OPS/DESIGN FLOW Have an image guideline. Create a workflow using

    the same image in all the software cycle stages. From design to production mimic the environment. Test heavily. Ǻ
  17. ORCHESTRATION Isolation of services. Make use of the resource available.

    Self healing. Load distribution. Adding nodes to your cluster. Ǻ
  18. DISCOVERY Find your services and datasources with minimal code change.

    Versioning of running services. Automagically update discovery when new services are online or scaled up/down. Ǻ
  19. SCALING/SCHEDULING Scale your containers. Scale your docker cluster. Scale your

    on/off jobs. Failover groups. Cross cloud clusters. Load balancing. Ǻ
  20. DATA MANAGEMENT Backup and restores. Clustering. Verify your backups. Run

    natively not in a container for non cloud native DBs. Ǻ 
  21. SECURITY Intrusion detection and prevention systems. Denial of service protection.

    Firewalling. Failover groups. Segregate container groups VPC / bastion servers. Verification of images. Ǻ Ǻ
  22. SMALL SECURE PERFORMANT STABLE
 IMMUTABLE Ɨ ǽ DEV/OPS/DESIGN FLOW ORCHESTRATION

    DISCOVERY SCALING/SCHEDULING DATA MANAGMENT MONITORING SECURITY MLI PLATFORM CONTAINERS AS A SERVICE
  23. When you get DevOps right, Microservices architecture right and creating

    the right minimal lovable Image and having the right platform to run containers. Ohh man, the future is bright and you don’t go to hell! ǽ