cri-o

command module
v0.0.0-...-eccee7d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

README

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/containers/Demos/cri-o"
	"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:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL