Skip to content

Instantly share code, notes, and snippets.

@ryanj
Forked from katiejots/connecting-containers.html
Last active August 29, 2015 14:13
Show Gist options
  • Save ryanj/b97ec3571350729ba3e6 to your computer and use it in GitHub Desktop.
Save ryanj/b97ec3571350729ba3e6 to your computer and use it in GitHub Desktop.
<!-- Opening -->
<section>
<section>
<h1 style="font-size: 3.4em; margin-top: -25px;">Connecting Containers</h1>
<img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/boxillusion.png" style="width: 210px; background-color: inherit; border: none; box-shadow: none;"/>
<h3>Building a PaaS with Docker and&nbsp;Kubernetes</h3>
<p>
Presented by<br/>
<a href="http://www.codemiller.com">Katie Miller</a> / <a
href="http://twitter.com/codemiller">@codemiller</a><br/>
<a href="http://thesteve0.wordpress.com">Steve Pousty</a> / <a
href="https://twitter.com/TheSteve0">@TheSteve0</a>
</p>
</section>
<section>
</section>
</section>
<!-- Introduction to PaaS/OpenShift -->
<section>
<section>
<h2>Platform&nbsp;as&nbsp;a&nbsp;Service</h2>
</section>
<section>
<img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/paas.png" style="height: 600px; padding: 20px; background-color: rgba(255, 255, 255, 0.25);" />
</section>
<section>
<h2>OpenShift</h2>
</section>
<section>
<img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/openshift-triangle.png" style="max-height: 500px; padding: 20px; background-color: white;"/>
</section>
<section>
<h2>Reasons to Rebuild</h2>
</section>
<section>
<img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/originv3stack.png" style="max-height: 500px;"/>
</section>
</section>
<!-- Atomic Overview -->
<section>
<section>
<img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/projectatomic.png" style="width: 350px;padding: 20px;"/>
</section>
<section>
<h2>New infrastructure and learning</h2>
<h3 class="fragment">Virtualization and then Cloud</h3>
<h3 class="fragment">A lot of experience with Linux</h3>
</section>
<section>
<h2>RPM-OSTree</h2>
<h4>A system to compose RPMs on a server side into an OSTree repository</h4>
</section>
<section>
<h2>Minimal System</h2>
<h3 class="fragment">Best supported kernel in the world</h3>
<h3 class="fragment">All the System Utilities you need and nothing else </h3>
</section>
<section>
<h2>Containers 1st class citizens</h2>
<h3 class=fragment>Made for running containers</h3>
<h3 class=fragment>Includes <a href="http://cockpit-project.org/" target="_blank">a console for management </a></h3>
</section>
<section>
<h2>Wins</h2>
</section>
</section>
<!-- Docker Overview -->
<section>
<section>
<img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/docker-logo.png" style="height: 350px;padding: 20px; background-color: white;"/>
</section>
<section>
<h2>Defining Container</h2>
<table>
<tr>
<td><img style="height: 300px;" src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/docker_container.jpg" alt="Diagram of a multi-layered docker container" /></td>
<td style="vertical-align: middle;">
<ul>
<li>In Docker parlance, a <em>container</em> is a running instance of an <em>image</em></li>
<li>Based on linux containers (namepaces, control groups)</li>
<li>Combines file system <em>layers</em> into a "Union File System"</li>
<li>Includes all of the components necessary to run a process, store persistent data, or both</li>
</ul>
</td>
</tr>
</table>
</section>
<section>
<h2>Containers vs. VMs</h2>
<img style="height: 500px;" src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/docker_vm_diagram.jpg" alt="Docker and VM comparison diagram" />
</section>
<section>
<h2>Container Operations</h2>
<p>Instantiate a Docker container with <code>docker run</code>:</p>
<pre><code>$ docker run -i -t nhripps/centos /bin/bash
bash-4.1# exit
exit</code></pre>
<p>&nbsp;<br />List running and exited docker processes with <code>docker ps</code>:</p>
<pre><code>$ docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS NAMES
7c4ef3596fa5 nhripps/centos:latest "/bin/bash" 49 seconds ago Exited (0) grave_newton</code></pre>
<p>&nbsp;<br />Rejoin containers with <code>docker attach</code>:</p>
<pre><code>$ docker start grave_newton
grave_newton
$ docker attach grave_newton
bash-4.1# exit
exit</code></pre>
</section>
<section>
<h2>"Diffing" a Container</h2>
<p>Run a Docker image and perform some actions:</p>
<pre><code>$ docker run -i -t --name="add_wget" nhripps/centos /bin/bash
bash-4.1# yum install -y wget
...
bash-4.1# exit</code></pre>
<p>Run a diff on the container after it has run:</p>
<pre><code>$ docker diff add_wget
C /.bash_history
C /etc
A /etc/wgetrc
C /tmp
C /usr
C /usr/bin
A /usr/bin/wget
C /usr/share
C /usr/share/doc
A /usr/share/doc/wget-1.12
...</code></pre>
</section>
<section>
<h2>Docker Containers as Daemons</h2>
<img style="height: 400px;" src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/docker_bunny.png" alt="Docker Containers Just Keep Going..." />
<p>A docker container runs until:</p>
<ul>
<li>The process inside it exits <em>or</em></li>
<li>You stop it with <code>docker stop &lt;container_name&gt;</code></li>
</ul>
</section>
<section>
<h2>Linking Containers</h2>
<table style="margin-left: auto; margin-right: auto;">
<tr>
<td><img style="background-color: #FFF;" src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/docker_links.png" alt="Docker links diagram" /></td>
<td style="vertical-align: middle;">
<ul>
<li>Containers on the same host can be linked together</li>
<li>Links between containers are not accessible outside the host</li>
<li>Links are shared via ENV and /etc/hosts</li>
</ul>
</td>
</tr>
</table>
</section>
<section>
<h2>Docker: Pros and Cons</h2>
<table style="margin-left: auto; margin-right: auto;">
<tr>
<td>
<p>PROS:</p>
<ul>
<li>Extreme application portability</li>
<li>Very easy to create and work with derivative images</li>
<li>Fast boot on containers</li>
</ul>
</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<p>CONS:</p>
<ul>
<li>Host-centric solution; not aware of anything else</li>
<li>No higher-level provisioning</li>
<li>No usage tracking / reporting</li>
</ul>
</td>
</tr>
</table>
</section>
<section>
<h2>Wins</h2>
</section>
</section>
<!-- Kubernetes Overview -->
<section>
<section>
<img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/kubernetes.png" style="width: 750px; padding: 20px;" />
</section>
<section>
<h3>kubernetes:</h3>
<div class="fragment">
<span style="font-style: italic; font-weight: bold;">koo-ber-nay'-tace</span> &nbsp;Greek for 'pilot' or 'helmsman'
</div>
<div class="fragment" style="margin-top: 20px">"a system for managing containerized applications across multiple hosts"</div>
<div class="fragment" style="margin-top: 20px">declarative model</div>
<div class="fragment" style="margin-top: 20px">open source project by Google</div>
</section>
<section>
<a href="https://github.com/GoogleCloudPlatform/kubernetes/graphs/contributors" target="_blank"><img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/kubecommits.png" style="height: 720px; margin-top: -40px;" /></a>
</section>
<section>
<h2>Terminology and Architecture</h2>
</section>
<section>
<h2>Concepts</h2>
<div><img style="border: 0px;" src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/concepts.png"></div>
<div>
<dl>
<dt>pod</dt>
<dd>colocated group of Docker containers that share an IP and storage volumes</dd>
<dt>service</dt>
<dd>provides a single, stable name for set of pods and acts as basic load balancer</dd>
<dt>replication controller</dt>
<dd>manages the lifecycle of pods and ensures specified number are running at any time</dd>
<dt>label</dt>
<dd>used to organize and select groups of objects</dd>
</dl>
</div>
</section>
<section>
<h2>Components</h2>
<div><img style="border: 0px;" src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/components.png"></div>
<div>
<dl>
<dt>cluster</dt>
<dd>compute resources on top of which containers are built</dd>
<dt>master</dt>
<dd>hosts cluster-level control services, including the API server, scheduler, and controller manager</dd>
<dt>node</dt>
<dd>Docker host running <em>kubelet</em> (node agent) and <em>proxy</em> services</dd>
<dt>etcd</dt>
<dd>distributed key-value store used to persist system state</dd>
</dl>
</div>
</section>
<section>
<h2>Wins</h2>
<h3 class="fragment">Runtime and operational management of containers</h3>
<div class="fragment" style="margin-top: 20px;">Manage related Docker containers as a unit</div>
<div class="fragment" style="margin-top: 20px;">Container communication across hosts</div>
<div class="fragment" style="margin-top: 20px;">Availability and scalability through automated deployment and monitoring of pods and their replicas, across&nbsp;hosts</div>
</section>
</section>
<!-- OpenShift v3 Overview -->
<section>
<section>
<h2>Building OpenShift v3</h2>
</section>
<section>
<h2>Wins</h2>
</section>
</section>
<!-- Demo -->
<section>
<section>
<h2>Demo</h2>
</section>
</section>
<!-- Conclusion -->
<section>
<section>
<h2>Conclusion</h2>
</section>
<section>
</section>
</section>
<!-- References/Resources -->
<section>
<section>
<h2>References and Resources</h2>
<ul>
<li><a href="http://reinvent-hripps.rhcloud.com/#/2" target="_blank">Docker, Kubernetes, and OpenShift 3 labs</a></li>
<li><a href="http://docker.io/" target="_blank">Docker website</a></li>
<li><a href="https://github.com/GoogleCloudPlatform/kubernetes" target="_blank">Kubernetes source</a></li>
<li><a href="http://kubernetes.io" target="_blank">Kubernetes website</a></li>
<li><a href="https://github.com/openshift/openshift-pep/blob/master/openshift-pep-013-openshift-3.md" target="_blank">OpenShift 3.x System Design PEP</a></li>
<li><a href="https://github.com/openshift/origin" target="_blank">OpenShift Origin source</a></li>
<li><a href="http://www.openshift.org/" target="_blank">OpenShift Origin website</a></li>
<li><a href="https://blog.openshift.com/openshift-v3-deep-dive-docker-kubernetes/" target="_blank">OpenShift v3 Deep Dive Tutorial</a></li>
<li><a href="https://blog.openshift.com/openshift-v3-platform-combines-docker-kubernetes-atomic-and-more/" target="_blank">OpenShift v3 Platform Announcement</a></li>
</ul>
</section>
<section>
<h2>Image Credits</h2>
<ul>
<li><a href="https://openclipart.org" target="_blank">Open ClipArt</a></li>
</ul>
</section>
</section>
<!-- End -->
<section>
<section>
<h1>Connecting Containers</h1>
<img src="https://raw.githubusercontent.com/codemiller/connecting-containers/gh-pages/images/boxillusion.png" style="width: 210px; background-color: inherit; border: none; box-shadow: none;"/>
<h3><a href="http://containers.codemiller.com">http://containers.codemiller.com</a></h3>
<p>
Presented by<br/>
<a href="http://www.codemiller.com">Katie Miller</a> / <a
href="http://twitter.com/codemiller">@codemiller</a><br/>
<a href="http://thesteve0.wordpress.com">Steve Pousty</a> / <a
href="https://twitter.com/TheSteve0">@TheSteve0</a>
</p>
</section>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment