Skip to content
This repository has been archived by the owner on Jan 5, 2020. It is now read-only.
/ crio-demos Public archive

CRI-O Demonstration Material

Notifications You must be signed in to change notification settings

saschagrunert/crio-demos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRI-O Demos

This repository aims to provide you the demo material for the Kubernetes container runtime CRI-O.

Requirements

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
  • A working Kubeconfig to access that cluster in $HOME/.kube/config
  • A working crictl binary and configuration

Contents

  1. Basic interactions with CRI-O
  2. Logging and live configuration reload
  3. Life Cycle of a Kubernetes workload
  4. Port Forward
  5. Recovering
  6. Networking
  7. Pull Auth
  8. Registries
  9. Registry Mirrors
  10. Storage

How to use

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)

How it works

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)
}

A full working demo would look like this:

Releases

No releases published

Packages

No packages published

Languages