• Stars
    star
    3,587
  • Rank 12,360 (Top 0.3 %)
  • Language
    Shell
  • License
    Other
  • Created over 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Slides and code samples for training, tutorials, and workshops about Docker, containers, and Kubernetes.

Container Training

This repository (formerly known as orchestration-workshop) contains materials (slides, scripts, demo app, and other code samples) used for various workshops, tutorials, and training sessions around the themes of Docker, containers, and orchestration.

For the moment, it includes:

  • Introduction to Docker and Containers,
  • Container Orchestration with Docker Swarm,
  • Container Orchestration with Kubernetes.

These materials have been designed around the following principles:

  • they assume very little prior knowledge of Docker, containers, or a particular programming language;
  • they can be used in a classroom setup (with an instructor), or self-paced at home;
  • they are hands-on, meaning that they contain lots of examples and exercises that you can easily reproduce;
  • they progressively introduce concepts in chapters that build on top of each other.

If you're looking for the materials, you can stop reading right now, and hop to http://container.training/, which hosts all the slides decks available.

The rest of this document explains how this repository is structured, and how to use it to deliver (or create) your own tutorials.

Why a single repository?

All these materials have been gathered in a single repository because they have a few things in common:

What are the different courses available?

Introduction to Docker is derived from the first "Docker Fundamentals" training materials. For more information, see jpetazzo/intro-to-docker. The version in this repository has been adapted to the Markdown publishing pipeline. It is still maintained, but only receives minor updates once in a while.

Container Orchestration with Docker Swarm (formerly known as "Orchestration Workshop") is a workshop created by Jérôme Petazzoni in June 2015. Since then, it has been continuously updated and improved, and received contributions from many others authors. It is actively maintained.

Container Orchestration with Kubernetes was created by Jérôme Petazzoni in October 2017, with help and feedback from a few other contributors. It is actively maintained.

Repository structure

  • bin
    • A few helper scripts that you can safely ignore for now.
  • dockercoins
    • The demo app used throughout the orchestration workshops.
  • efk, elk, prom, snap:
    • Logging and metrics stacks used in the later parts of the orchestration workshops.
  • prepare-local, prepare-machine:
    • Contributed scripts to automate the creation of local environments. These could use some help to test/check that they work.
  • prepare-vms:
    • Scripts to automate the creation of AWS instances for students. These are routinely used and actively maintained.
  • slides:
    • All the slides! They are assembled from Markdown files with a custom Python script, and then rendered using gnab/remark. Check this directory for more details.
  • stacks:
    • A handful of Compose files (version 3) allowing to easily deploy complex application stacks.

Course structure

(This applies only for the orchestration workshops.)

The workshop introduces a demo app, "DockerCoins," built around a micro-services architecture. First, we run it on a single node, using Docker Compose. Then, we pretend that we need to scale it, and we use an orchestrator (SwarmKit or Kubernetes) to deploy and scale the app on a cluster.

We explain the concepts of the orchestrator. For SwarmKit, we setup the cluster with docker swarm init and docker swarm join. For Kubernetes, we use pre-configured clusters.

Then, we cover more advanced concepts: scaling, load balancing, updates, global services or daemon sets.

There are a number of advanced optional chapters about logging, metrics, secrets, network encryption, etc.

The content is very modular: it is broken down in a large number of Markdown files, that are put together according to a YAML manifest. This allows to re-use content between different workshops very easily.

DockerCoins

The sample app is in the dockercoins directory. It's used during all chapters for explaining different concepts of orchestration.

To see it in action:

  • cd dockercoins && docker-compose up -d
  • this will build and start all the services
  • the web UI will be available on port 8000

Running the Workshop

If you want to deliver one of these workshops yourself, this section is for you!

*This section has been mostly contributed by Bret Fisher, who was one of the first persons to have the bravery of delivering this workshop without me. Thanks Bret! 🍻

Jérôme.*

General timeline of planning a workshop

  • Fork repo and run through slides, doing the hands-on to be sure you understand the different dockercoins repo's and the steps we go through to get to a full Swarm Mode cluster of many containers. You'll update the first few slides and last slide at a minimum, with your info.
  • Your docs directory can use GitHub Pages.
  • This workshop expects 5 servers per student. You can get away with as little as 2 servers per student, but you'll need to change the slide deck to accommodate. More servers = more fun.
  • If you have more then ~20 students, try to get an assistant (TA) to help people with issues, so you don't have to stop the workshop to help someone with ssh etc.
  • AWS is our most tested process for generating student machines. In prepare-vms you'll find scripts to create EC2 instances, install docker, pre-pull images, and even print "cards" to place at each students seat with IP's and username/password.
  • Test AWS Scripts: Be sure to test creating all your needed servers a week before workshop (just for a few minutes). You'll likely hit AWS limits in the region closest to your class, and it sometimes takes days to get AWS to raise those limits with a support ticket.
  • Create a https://gitter.im chat room for your workshop and update slides with url. Also useful for TA to monitor this during workshop. You can use it before/after to answer questions, and generally works as a better answer then "email me that question".
  • If you can send an email to students ahead of time, mention how they should get SSH, and test that SSH works. If they can ssh github.com and get permission denied (publickey) then they know it worked, and SSH is properly installed and they don't have anything blocking it. SSH and a browser are all they need for class.
  • Typically you create the servers the day before or morning of workshop, and leave them up the rest of day after workshop. If creating hundreds of servers, you'll likely want to run all these workshopctl commands from a dedicated instance you have in same region as instances you want to create. Much faster this way if you're on poor internet. Also, create 2 sets of servers for yourself, and use one during workshop and the 2nd is a backup.
  • Remember you'll need to print the "cards" for students, so you'll need to create instances while you have a way to print them.

Things That Could Go Wrong

  • Creating AWS instances ahead of time, and you hit its limits in region and didn't plan enough time to wait on support to increase your limits. :(
  • Students have technical issues during workshop. Can't get ssh working, locked-down computer, host firewall, etc.
  • Horrible wifi, or ssh port TCP/22 not open on network! If wifi sucks you can try using MOSH https://mosh.org which handles SSH over UDP. TMUX can also prevent you from losing your place if you get disconnected from servers. https://tmux.github.io
  • Forget to print "cards" and cut them up for handing out IP's.
  • Forget to have fun and focus on your students!

Creating the VMs

prepare-vms/workshopctl is the script that gets you most of what you need for setting up instances. See prepare-vms/README.md for all the info on tools and scripts.

Content for Different Workshop Durations

With all the slides, this workshop is a full day long. If you need to deliver it in shorter timelines, here's some recommendations on what to cut out. You can replace --- with ??? which will hide slides. Or leave them there and add something like (EXTRA CREDIT) to title so students can still view the content but you also know to skip during presentation.

3 Hour Version

  • Limit time on debug tools, maybe skip a few. "Chapter 1: Identifying bottlenecks"
  • Limit time on Compose, try to have them building the Swarm Mode by 30 minutes in
  • Skip most of Chapter 3, Centralized Logging and ELK
  • Skip most of Chapter 4, but keep stateful services and DAB's if possible
  • Mention what DAB's are, but make this part optional in case you run out of time

2 Hour Version

  • Skip all the above, and:
  • Skip the story arc of debugging dockercoins all together, skipping the troubleshooting tools. Just focus on getting them from single-host to multi-host and multi-container.
  • Goal is first 30min on intro and Docker Compose and what dockercoins is, and getting it up on one node in docker-compose.
  • Next 60-75 minutes is getting dockercoins in Swarm Mode services across servers. Big Win.
  • Last 15-30 minutes is for stateful services, DAB files, and questions.

Pre-built images

There are pre-built images for the 4 components of the DockerCoins demo app: dockercoins/hasher:v0.1, dockercoins/rng:v0.1, dockercoins/webui:v0.1, and dockercoins/worker:v0.1. They correspond to the code in this repository.

There are also three variants, for demo purposes:

  • dockercoins/rng:v0.2 is broken (the server won't even start),
  • dockercoins/webui:v0.2 has bigger font on the Y axis and a green graph (instead of blue),
  • dockercoins/worker:v0.2 is 11x slower than v0.1.

Past events

Since its inception, this workshop has been delivered dozens of times, to thousands of people, and has continuously evolved. This is a short history of the first times it was delivered. Look also in the "tags" of this repository: they all correspond to successive iterations of this workshop. If you attended a past version of the workshop, you can use these tags to see what has changed since then.

  • QCON, New York City (2015, June)
  • KCDC, Kansas City (2015, June)
  • JDEV, Bordeaux (2015, July)
  • OSCON, Portland (2015, July)
  • StrangeLoop, Saint Louis (2015, September)
  • LISA, Washington D.C. (2015, November)
  • SCALE, Pasadena (2016, January)
  • Zenika, Paris (2016, February)
  • Container Solutions, Amsterdam (2016, February)
  • ... and much more!

Problems? Bugs? Questions?

If there is a bug and you can fix it: submit a PR. Make sure that I know who you are so that I can thank you (because you're the real MVP!)

If there is a bug and you can't fix it, but you can reproduce it: submit an issue explaining how to reproduce.

If there is a bug and you can't even reproduce it: sorry. It is probably an Heisenbug. We can't act on it until it's reproducible, alas.

“Please teach us!”

If you have attended one of these workshops, and want your team or organization to attend a similar one, you can look at the list of upcoming events on http://container.training/.

You are also welcome to reuse these materials to run your own workshop, for your team or even at a meetup or conference. In that case, you might enjoy watching Bridget Kromhout's talk at KubeCon 2018 Europe, explaining precisely how to run such a workshop yourself.

Finally, you can also contact the following persons, who are experienced speakers, are familiar with the material, and are available to deliver these workshops at your conference or for your company:

  • jerome dot petazzoni at gmail dot com
  • bret at bretfisher dot com

(If you are willing and able to deliver such workshops, feel free to submit a PR to add your name to that list!)

Thank you!

More Repositories

1

pipework

Software-Defined Networking tools for LXC (LinuX Containers)
Shell
4,139
star
2

nsenter

Shell
2,582
star
3

ampernetacle

HCL
2,519
star
4

dind

Docker in Docker
Shell
2,474
star
5

dockvpn

Recipe to build an OpenVPN image for Docker
Shell
833
star
6

squid-in-a-can

Python
357
star
7

pxe

Dockerfile to build a PXE server in a Docker container
Shell
250
star
8

minimage

Minimal Docker images: a collection of Dockerfiles illustrating how to reduce container image size.
Shell
206
star
9

griode

Griode + Novation Launchpad + Raspberry Pi = a music instrument!
Python
139
star
10

registrish

Dirty hack to run a read-only, public Docker registry on almost any static file hosting service (e.g. NGINX, Netlify, S3...)
Shell
136
star
11

shpod

Container image to get a consistent training environment to work on Kubernetes.
Dockerfile
134
star
12

critmux

Docker + CRIU + tmux = magic!
Dockerfile
117
star
13

dockercoins

Python
98
star
14

docker-busybox

Busybox for Stackbrew
Shell
94
star
15

sekexe

Separate Kernel Execution: execute a process within user-mode-linux and retrieve its output and status code
Shell
79
star
16

dessine-moi-un-cluster

Instructions to build a Kubernetes control plane one piece at a time, for learning purposes.
Shell
78
star
17

gunsub

Get your github notifications under control!
Python
74
star
18

syslogdocker

70
star
19

stevedore

Containerize your development environments
Shell
68
star
20

hamba

Shell
67
star
21

obs-docker

OBS-Studio (and a few extra tools) in containers
Python
62
star
22

docker2docker

Shell
26
star
23

wordsmith

Java
23
star
24

intro-to-docker

CSS
23
star
25

jpetazzo.github.io

HTML
22
star
26

go-docker-

20
star
27

trainingwheels

HTML
18
star
28

snakedeck

Elgato StreamDeck controller for Linux, in Python.
Python
17
star
29

nsplease

Tiny Kubernetes operator to create Namespaces on demand (for CI/CD, for instance)
Shell
16
star
30

django

Django on DotCloud tutorial
Python
16
star
31

whisperfiles

A bunch of Dockerfiles for OpenAI Whisper, to illustrate various image optimization techniques
Shell
15
star
32

foundation-example

Shell
14
star
33

httpenv

Tiny HTTP server showing the environment variables
Go
14
star
34

dctrl

Shell
13
star
35

buildkit-demos

Dockerfile
13
star
36

orchestration-workshop

We have moved! We are now at → https://github.com/jpetazzo/container.training
HTML
12
star
37

decoup

Python
11
star
38

layeremove

Surgically remove layers from a Docker image (with a chainsaw)
Python
11
star
39

znc-on-dotcloud

Shell
11
star
40

tilestream-on-dotcloud

Python
10
star
41

littleboxes

Just for fun scripts to manage local cloud-like VMs with KVM
Shell
10
star
42

django-and-mongodb-on-dotcloud

Django on DotCloud tutorial, using MongoDB to store objects!
Python
10
star
43

kubercoins

8
star
44

sstk

Shell
8
star
45

geodjango-on-dotcloud

Python
7
star
46

meteor-on-dotcloud

7
star
47

solr-on-dotcloud

JavaScript
7
star
48

seleterm

Selenium for terminal applications
Python
6
star
49

snap-on-dotcloud

Shell
6
star
50

httplat

Minimalist Prometheus exporter to collect the latency of an HTTP target
Go
6
star
51

boggle

Solver for the Boggle Word Game
Python
6
star
52

mume

Python
6
star
53

gitorial

(Ab)use git history to write tutorials!
Python
6
star
54

postgresql-on-dotcloud

Python
5
star
55

django-on-gpaas

Django on GANDI PAAS
Python
5
star
56

scangraph

Retrieve point coordinates from a raster plot
JavaScript
5
star
57

hano

Online IDE for Node.js on dotCloud
Shell
5
star
58

pyramid-on-dotcloud

Python
5
star
59

traefik-compose

Quick demo showing how to run web sites (like Wordpress) on Docker with Traefik
4
star
60

plumber

Shell
4
star
61

consul

jpetazzo's Consul image
Shell
4
star
62

zwave-exporter

Prometheus exporter for Z-Wave sensors
JavaScript
4
star
63

jenkins-on-dotcloud

Shell
4
star
64

color

Go
4
star
65

busyhttp

A trivial HTTP server that eats CPU cycles at each request.
Python
4
star
66

tinydocgen

Tiny document generator using Jinja2, Markdown, and WeasyPrint.
Makefile
3
star
67

ngrok

3
star
68

charliebot

Python
3
star
69

prettypictures

3
star
70

usb-webcam-analyzer

Python
3
star
71

rickroll-in-docker

HTML
3
star
72

dnc

Domain Name Command-line tool
Python
3
star
73

python-simple-logging

Python
3
star
74

replay.container.training

Shell
3
star
75

riak-on-dotcloud-ALPHA

Shell
3
star
76

ucengine-on-dotcloud-ALPHA

Shell
3
star
77

django-r2d2

R2D2 (RRDDashboard) is a Django application to draw graphs from metrics coming from e.g. collectd.
Python
3
star
78

pieuvre

Distributed HTTP proxy in Node.js
JavaScript
2
star
79

tmp-sealedsecret-juin-2022

2
star
80

couchdb-on-dotcloud-ALPHA

Shell
2
star
81

escapehash

Python
2
star
82

dockerhubratelimit

Shell
2
star
83

python-worker-on-dotcloud

Shell
2
star
84

tcl-on-dotcloud-ALPHA

Shell
2
star
85

elastic-gke

HCL
2
star
86

dampmam

Docker-Apache-MySQL-PHP but without Apache and MySQL
JavaScript
2
star
87

watchdns

Shell
2
star
88

workflows

2
star
89

highfive

Dockerfile
2
star
90

memcached-on-dotcloud

2
star
91

pawd

PulseAudio Web Daemon
2
star
92

pingr

HTTP server to ping other servers and report their status
Go
2
star
93

dotfiles-old

Config files for various environments
Shell
2
star
94

pgpool-II-on-dotcloud

2
star
95

ls

An ls image for the Docker Fundamentals training
Shell
2
star
96

jetty-on-dotcloud

Reimplementation of dotCloud java service using the custom build API
Shell
2
star
97

dockage

Shell
2
star
98

tornado-on-dotcloud

Python
2
star
99

aiguillage

Nginx
2
star
100

aurevoir

Web directory allowing non-zeroconf clients to browse zeroconf services
Python
2
star