Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Tips and tricks for containers on AWS (WebSummi...

Abby Fuller
April 27, 2018
120

Tips and tricks for containers on AWS (WebSummit 2017)

Abby Fuller

April 27, 2018
Tweet

Transcript

  1. Agenda • Let’s talk microservices • Orchestration choices on AWS

    • Amazon EC2 Container Service • Kubernetes • Deployments • Community builders!
  2. What are microservices? “Service-oriented architecture composed of loosely coupled elements

    that have bounded contexts” -Adrian Cockcroft (VP of Cloud Architecture @ AWS, former Cloud Architect at Netflix)
  3. A couple of general best practices • Rely on the

    public API • Use the right tool for the job • Secure your services • Be a good microservices citizen • Organizational changes matters • Automate where plausible
  4. How do I deploy my containers to hosts? How do

    I do zero downtime or blue green deployments? How do I keep my containers alive? How can my containers talk to each other? How do I do service discovery? What about secrets? How do I best optimize my "pool of compute”?
  5. © 2017, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Elastic Container Service • Highly scaleable, high performance container management system. • Eliminates the need to install, operate and scale your own container management system.
  6. © 2017, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon ECS • ECS provides a managed platform for: Cluster management Container orchestration Deep AWS integration
  7. © 2017, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Kubernetes • Container orchestration platform that manages containers across your infrastructure in logical groups • Rich API to integrate 3rd parties • Open Source
  8. © 2017, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Fargate Fargate mode! For ECS right now, for EKS in 2018 • No infrastructure to manage or scale • Scale seamlessly on demand • Manage everything at the container level
  9. Bottom line: we want to be the best place to

    run your containers, however you want to do it.
  10. Beware points of failure • Source/version control all the things

    • e.g. git and AWS CodeCommit, registries • Smart image tagging • Shared dependencies • Deploy fast and often (and small!) • For Kubernetes: fault tolerance requires an extra step! Make sure you have tolerance for failure, and use autoscaling groups.
  11. Smaller images mean faster builds and deploys • Go smaller

    • Private image repository • e.g. Amazon ECR • Shared where possible • Avoid unnecessary add-ons CACHE
  12. Alerts are (mostly) good • Alert responsibly • Take advantage

    of the built-in AWS alert systems • e.g. aws-log driver or CloudWatch • Put checks or limits on services or clusters scaling • Log sorting for severity is important to avoid unnecessarily sending an alert
  13. Monitoring and logging are key • Utilize tools • e.g.

    AWS CloudWatch, Datadog • Logging for both containers and hosts • Avoid unnecessary noise here too: • Log levels! • Meaningful log messages (don’t just log the default) • Logs should actually help
  14. Automation where plausible • Scripts! • Utilize built-in AWS features

    • e.g. CodeCommit, CodePipeline, CodeDeploy • …but add checks by a human • Templates and tools are your friends! • CloudFormation, etc: use tools to help setup and create repeatable infrastructure
  15. Maximize your resources • Set sensible resource limits • Use

    a scaling policy to scale up or down and preclude resources from running idle • Utilize TaskPlacement policies
  16. Autoscaling is your friend • Autoscaling is your friend! •

    Don’t limit yourself to cluster autoscaling, write individual rules for services
  17. The right tools for the job • ALB vs ELB

    • Not all languages need to build the same • Set Service level scaling policies, plus cluster scaling policies • Regardless of orchestration tool, use a VPC! • Multi AZ • Bottom line: use what works for you!
  18. Checking for issues • Debugging • Monitor performance with tools

    like X-Ray • Connection draining settings • Health checks • Check for actual health • Look for number of failed checks before declaring unhealthy