32
Tips and tricks for running container workloads on AWS Abby Fuller, Sr Technical Evangelist, AWS @abbyfuller

Tips and Tricks for Running Container Workloads on AWS

Embed Size (px)

Citation preview

Page 1: Tips and Tricks for Running Container Workloads on AWS

TipsandtricksforrunningcontainerworkloadsonAWS

AbbyFuller,Sr TechnicalEvangelist,AWS@abbyfuller

Page 2: Tips and Tricks for Running Container Workloads on AWS

Agenda

• Let’stalkmicroservices• OrchestrationchoicesonAWS• AmazonEC2ContainerService• Kubernetes• Deployments• Communitybuilders!

Page 3: Tips and Tricks for Running Container Workloads on AWS

Let’stalkmicroservices

Page 4: Tips and Tricks for Running Container Workloads on AWS

Whataremicroservices?

“Service-oriented architecturecomposed ofloosely coupled elementsthat havebounded contexts”

-AdrianCockcroft(VPofCloudArchitecture@AWS,formerCloudArchitectatNetflix)

Page 5: Tips and Tricks for Running Container Workloads on AWS

Acoupleofgeneralbestpractices

• 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

Page 6: Tips and Tricks for Running Container Workloads on AWS

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”?

Page 7: Tips and Tricks for Running Container Workloads on AWS

Containers are awesome

….but they’re more work

Page 8: Tips and Tricks for Running Container Workloads on AWS

Howcanyou(butmostlyme)dolesswork?#thoughtleadership

Page 9: Tips and Tricks for Running Container Workloads on AWS

Answer! Tools. More specifically, orchestration tools.

Page 10: Tips and Tricks for Running Container Workloads on AWS

OrchestrationchoicesonAWS

Page 11: Tips and Tricks for Running Container Workloads on AWS

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon EC2 Container Service

• Highly scaleable, high performance container management system. • Eliminates the need to install,

operate and scale your own container management system.

Page 12: Tips and Tricks for Running Container Workloads on AWS

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon ECS• ECS provides a managed platform for:

Clustermanagement Containerorchestration DeepAWSintegration

Page 13: Tips and Tricks for Running Container Workloads on AWS

© 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

Page 14: Tips and Tricks for Running Container Workloads on AWS

Whouseswhat?AmazonECS KubernetesonAWS

Page 15: Tips and Tricks for Running Container Workloads on AWS

Bottom line: we want to be the best place to run your containers, however you want to do it.

Page 16: Tips and Tricks for Running Container Workloads on AWS

Tipsandtricksforgettingthemostoutofyourdeployments

Page 17: Tips and Tricks for Running Container Workloads on AWS

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 autoscalinggroups.

Page 18: Tips and Tricks for Running Container Workloads on AWS

Smaller images mean faster builds and deploys• Go smaller• Private image repository• e.g. Amazon ECR

• Shared where possible• Avoid unnecessary add-ons CACHE

Page 19: Tips and Tricks for Running Container Workloads on AWS

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

Page 20: Tips and Tricks for Running Container Workloads on AWS

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

Page 21: Tips and Tricks for Running Container Workloads on AWS

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

Page 22: Tips and Tricks for Running Container Workloads on AWS

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

Page 23: Tips and Tricks for Running Container Workloads on AWS

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!

Page 24: Tips and Tricks for Running Container Workloads on AWS

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

Page 25: Tips and Tricks for Running Container Workloads on AWS

Helpisoutthere

Page 26: Tips and Tricks for Running Container Workloads on AWS

Buzzfeed andRig

Page 27: Tips and Tricks for Running Container Workloads on AWS

The Hitchhiker’s Guide

Page 28: Tips and Tricks for Running Container Workloads on AWS

coldbrew-cli

Page 29: Tips and Tricks for Running Container Workloads on AWS

AWSome ECS

Page 30: Tips and Tricks for Running Container Workloads on AWS

kubernetes/kops

Page 31: Tips and Tricks for Running Container Workloads on AWS

Kris Nova’s kubicorn

Page 32: Tips and Tricks for Running Container Workloads on AWS

Heptio andKubernetesquickstartforAWS