Config Management and Containers
Charles Butler
Fosdem 2016
We are the company
behind Ubuntu.
Genesis
“Operational pain can neither be created nor destroyed - only moved to someone else”
Well… You can create it… :)
System Management Patterns
Divergence
Convergence
Congruence
Config Management Solved Problems
Stopped divergent delivery patterns from a pre-virtualized world
Best Attempt to eliminate snowflakes
Frameworks to describe machine state
Support upstream packaging (or from source deployments)
resource abstraction
1
2
3
4
5
Emergent issues w/ Config Management
Domain specific configuration managers
Context Sensitive Knowledge barriers.
10% technological—the rest is improved management, process, and user training. [1]
1
2
3
Enter Containers
The New Stack
Containers offer a way to virtualize an operating system.
This virtualization isolates processes, providing limited visibility and resource utilization to each, such that the processes appear to be running on separate machines.
Flavors
Application Containers
System Containers
Confidential Canonical™
image credit: https://www.howtoforge.com/tutorial/how-to-use-docker-introduction/
Benefits of “the new stack”
Resource Constraints
Density
Super Fast (often sub second)
No VM Overhead
1
2
3
4
Why Config Management & Containers
A critical look
Model Everything
Model containers and non-containers
manage not only the containers, but the environments around the containers
This is especially important, as containerized applications are nearly always talking to components
that are not in containers, and in some (rare) cases: unable to be placed in a container.
Chuck’s Adventure
Chuck’s Adventure
Delivery Patterns
Application containers vs uncontained delivery
Before
Kubernetes Charm as a Case Study
2283 total LOC
5317 total LOC
3,034 LOC reduction in cost of ownership
uncontained Delivery
containerized Delivery
Confidential Canonical™
After (mid flight)
Take a closer look @ the
Kubernetes Example
layer-docker
http://github.com/juju-solutions/layer-docker
charms.docker
opts = DockerOpts()
opts.add(‘allow-insecure-registry’, True)
opts.to_string()
charms.docker
from charms.docker import Docker�d = Docker()�pid = d.up('lazypower/idlerpg:latest', � dirs={"files/idlerpg":"/files/idlerpg"}, � ports=["8000:8000"])
charms.docker
from charms.docker.compose import Compose
compose = Compose(‘files/tikiwiki’)
compose.up(‘mysql’)
compose.kill()
compose.rm()
Containers as Payloads
Containers as Payloads
LXD ships with everything you need
LXD can act as a hosting image server
Where is charms.lxd then?
Simply stated:
LXC/LXD is natively supported in Juju. These “primitives” are exposed as a native “machine” to create units for an Application.
These principles work in every CM toolkit
Ansible Modules
https://github.com/kbrebanov/ansible-lxd
http://docs.ansible.com/ansible/lxc_container_module.html
Deliver and manage System Containers
http://docs.ansible.com/ansible/docker_module.html
�Deliver and manage Application Containers
Chef Cookbooks
https://supermarket.chef.io/cookbooks/container
Deliver and manage System Containers
https://supermarket.chef.io/cookbooks/docker
Deliver and manage Application Containers
Puppet Modules
https://github.com/tripledes/sjimenez-lxc
Deliver and manage System Containers
https://forge.puppetlabs.com/garethr/docker
Deliver and manage Application Containers
Salt Stack
https://docs.saltstack.com/en/latest/topics/cloud/lxc.html
Create / Manage System Containers
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.dockerng.html
Create / Manage Application Containers
Thanks for your time
Come see us @ CFGMGMTCAMP 2016 in Gent
http://summit.juju.solutions