SpringOne Platform 2016
Speaker: Casey West; Principal Technologist, Pivotal
This talk will use the seminal twelve-factor app essay as a guide to discuss the do’s and dont’s of building and running containers. Each factor gives us an opportunity to consider avoidable anti-patterns if you’re using containers to deploy and manage repeatable, reliable, and portable services.
Containers rose in popularity on an oft used metaphor: lightweight virtual machines. We have a robust understanding of the benefits of virtualized hardware as a method of efficient resource utilization. The idea of even more efficient resource utilization makes sense. Unfortunately it’s a problematic metaphor.
Containers represent a constrained set of capabilities compared to virtual machines in order to make fine-grained guarantees about resource constraints and process isolation. This is a good thing. There is overlap in ideal capabilities between VMs and containers but it isn’t complete. Newcomers to the container ecosystem begin with a “lightweight VM” understanding and fall victim to specific anti-patterns.
After this talk you’ll understand common pitfalls in containerization and how you can avoid them. This discussion is useful for developers who wish to gain greater understanding of the environment their applications are deployed to, as well as operators interested in the benefits of containers for their architecture.
18. Best Practice
Depend on base images
for default filesystem
and runtimes
18 ! @caseywest #S1P #containers #operability #ops #12factor #realtalk #til
19. 3: Store config in the
environment
19 ! @caseywest #S1P #containers #operability #ops #12factor #realtalk #til
29. Best Practice
Connect to network-
attached services using
connection info from
the environment
29 ! @caseywest #S1P #containers #operability #ops #12factor #realtalk #til
30. 5: Strictly separate
build and run stages
30 ! @caseywest #S1P #containers #operability #ops #12factor #realtalk #til
33. Painfully Obvious Best Practices
Eat when hungry
Sleep when tired
Book Casey West for
speaking gigs
33 ! @caseywest #S1P #containers #operability #ops #12factor #realtalk #til
34. Best Practice
Respect the lifecycle:
build, run, destroy
34 ! @caseywest #S1P #containers #operability #ops #12factor #realtalk #til
35. 6: Execute the app as
one or more stateless
processes
35 ! @caseywest #S1P #containers #operability #ops #12factor #realtalk #til
36. Best Practice
Schedule LRPs by
distributing them
across a cluster of
physical hardware
36 ! @caseywest #S1P #containers #operability #ops #12factor #realtalk #til