This repository has been archived by the owner on Jan 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interaction.go
72 lines (61 loc) · 1.62 KB
/
interaction.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package runs
import (
. "github.com/saschagrunert/crio-demos/pkg/demo"
"github.com/urfave/cli"
)
func Interaction(ctx *cli.Context) error {
d := New(
"Basic interactions with CRI-O",
"This demo shows basic interactions with CRI-O, the kubelet",
"and between both of them",
)
d.Step(S(
"The recommended way of running CRI-O is within a systemd unit.",
"Let’s verify that CRI-O is running as expected",
), S(
"sudo systemctl --no-pager status crio",
))
d.Step(S(
"If CRI-O is up and running, then a kubelet instance can",
"be configured to run CRI-O",
), S(
"sudo systemctl --no-pager status kubelet",
))
d.Step(S(
"We can use the tool `crictl` to interact with the Container Runtime ",
"Interface (CRI). To let this work out of the box with CRI-O, we",
"just have to adapt the configuration file `/etc/crictl.yaml`.",
), S(
"cat /etc/crictl.yaml",
))
d.Step(S(
"We should be now able to interact with CRI-O via `crictl`",
), S(
"sudo crictl version",
))
d.Step(S(
"We can list the pods and their status",
), S(
"sudo crictl pods",
))
d.Step(S(
"Or the containers",
), S(
"sudo crictl ps -a",
))
d.Step(S(
"All crictl calls result in direct gRPC request to CRI-O",
"For example, `crictl ps` results in a `ListContainersRequest`.",
), S(
"sudo journalctl -u crio --since '1 seconds ago' |",
"grep -Po '.*ListContainers(Request|Response){.*?}'",
))
d.Step(S(
"It looks like that the kubelet generally syncs periodically",
"with CRI-O.",
), S(
"sudo journalctl -u crio --no-pager --since '2 seconds ago' |",
"grep -Po 'time.*(Request|Response)'",
))
return d.Run(ctx)
}