This repository aims to provide you the demo material for the Kubernetes container runtime CRI-O.
The following requirements needs to be fulfilled to run the demos inside this repository:
- A running Kubernetes cluster (via systemd units) with CRI-O as configured
container runtime
- CRI-O configuration:
cgroup_manager = "systemd" conmon_cgroup = "system.slice"
- Kubelet should be started with:
-v=2 --cgroup-driver=systemd
- CRI-O configuration:
- A working Kubeconfig to access that cluster in
$HOME/.kube/config
- A working
crictl
binary and configuration
- Basic interactions with CRI-O
- Logging and live configuration reload
- Life Cycle of a Kubernetes workload
- Port Forward
- Recovering
- Networking
- Pull Auth
- Registries
- Registry Mirrors
- Storage
Each demo can be selected via its appropriate command line argument, whereas
multiple demos can be selected too. It is also possible to continuously run
the demos, avoid the manual [ENTER]
input and disable the typewriter effect.
-1, --interaction this demo shows basic interactions with CRI-O,
the kubelet and between both of them
-2, --logging this demo shows how to configure CRI-O logging
and reload the configuration during runtime
-3, --lifecycle this demo shows how CRI-O ensures the
containers life-cycle in conjunction with the
kubelet
-4, --port-forward this demo shows how port forwaring works in
CRI-O
-5, --recovering this demo shows what happens if a workload
unexpectedly stops
-6, --networking this demo shows how the basic networking works
in CRI-O
-7, --pull-auth this demo shows how registry authentication
works in CRI-O
-8, --registries this demo shows how to configure registries
with CRI-O
-9, --registry-mirrors this demo shows how to configure registries
mirrors in CRI-O
--10, --storage this demo shows how container storage can be
configured
--all run all demos
--auto, -a run the demo in automatic mode, where every
step gets executed automatically
--auto-timeout auto, -t auto the timeout to be waited when auto is enabled
(default: 3s)
--continuously, -c run the demos continuously without any end
--immediate, -i immediately output without the typewriter
animation
--skip-steps value, -s value skip the amount of initial steps within the
demo (default: 0)
Each demo contains a series of intermediate steps, whereas each step can contain a description and a command to be executed.
In source code, it would look like this:
package runs
import (
. "github.com/saschagrunert/crio-demos/pkg/demo"
"github.com/urfave/cli"
)
func Example(ctx *cli.Context) error {
d := New(
"Title",
"Some additional",
"multiline description",
)
d.Step(S(
"This is a possible",
"description of the command",
"to be executed",
), S(
"echo hello world",
))
// Commands to not need to have a description
d.Step(nil, S(
"echo without description",
))
// It is also not needed to provide a command
d.Step(S(
"Just a description without a command",
), nil)
return d.Run(ctx)
}