You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tutorial will walk you through the creation of [Redis](https://redis.io/) server running in a [Pod](http://kubernetes.io/docs/user-guide/pods/) using [crictl](https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md)
3
+
This tutorial will walk you through the creation of [Redis](https://redis.io/)
4
+
server running in a [Pod](http://kubernetes.io/docs/user-guide/pods/) using
It assumes you've already downloaded and configured `CRI-O`. If not, see [here for CRI-O](/install.md).
6
-
It also assumes you've set up CNI, and are using the default plugins as described [here](/contrib/cni/README.md). If you are using a different configuration, results may vary.
7
+
It assumes you've already downloaded and configured `CRI-O`. If not, see
8
+
[here for CRI-O](/install.md).
9
+
It also assumes you've set up CNI, and are using the default plugins as described
10
+
[here](/contrib/cni/README.md). If you are using a different configuration,
11
+
results may vary.
7
12
8
13
## Installation
9
14
10
15
This section will walk you through installing the following components:
11
16
12
17
* crictl - The CRI client for testing.
13
18
14
-
####Get crictl
19
+
### Get crictl
15
20
16
-
```
21
+
```shell
17
22
go get github.com/kubernetes-sigs/cri-tools/cmd/crictl
18
23
```
19
24
20
-
####Ensure the CRI-O service is running
25
+
### Ensure the CRI-O service is running
21
26
22
-
```
27
+
```shell
23
28
sudo crictl --runtime-endpoint unix:///var/run/crio/crio.sock version
24
29
```
25
-
```
30
+
31
+
```text
26
32
Version: 0.1.0
27
33
RuntimeName: cri-o
28
34
RuntimeVersion: 1.20.0-dev
@@ -33,43 +39,47 @@ RuntimeApiVersion: v1alpha1
33
39
> you can run `export CONTAINER_RUNTIME_ENDPOINT=unix:///var/run/crio/crio.sock`
34
40
> or `cp crictl.yaml /etc/crictl.yaml` from this repo
35
41
36
-
37
42
## Pod Tutorial
38
43
39
-
Now that the `CRI-O` components have been installed and configured we are ready to create a Pod. This section will walk you through launching a Redis server in a Pod. Once the Redis server is running we'll use telnet to verify it's working, then we'll stop the Redis server and clean up the Pod.
44
+
Now that the `CRI-O` components have been installed and configured you are ready
45
+
to create a Pod. This section will walk you through launching a Redis server
46
+
in a Pod. Once the Redis server is running we'll use telnet to verify it's working,
47
+
then we'll stop the Redis server and clean up the Pod.
40
48
41
49
### Creating a Pod
42
50
43
-
First we need to setup a Pod sandbox using a Pod configuration, which can be found in the `CRI-O` source tree:
51
+
First we need to setup a Pod sandbox using a Pod configuration, which can be found
52
+
in the `CRI-O` source tree:
44
53
45
-
```
54
+
```shell
46
55
cd$GOPATH/src/github.com/cri-o/cri-o
47
56
```
48
57
49
-
In case the file `/etc/containers/policy.json` does not exist on your filesystem, make sure that skopeo has been installed correctly. You can use a policy template provided in the CRI-O source tree, but it is insecure and it is not to be used on production machines:
58
+
In case the file `/etc/containers/policy.json` does not exist on your filesystem,
59
+
make sure that Skopeo has been installed correctly. You can use a policy template
60
+
provided in the CRI-O source tree, but it is insecure and it is not to be used
61
+
on production machines:
50
62
51
-
```
63
+
```shell
52
64
sudo mkdir /etc/containers/
53
65
sudo cp test/policy.json /etc/containers
54
66
```
55
67
56
-
57
68
Next create the Pod and capture the Pod ID for later use:
Use the `crictl` command to pull the Redis image, create a Redis container from a container configuration and attach it to the Pod created earlier, while capturing the container ID:
102
+
Use the `crictl` command to pull the Redis image, create a Redis container from
103
+
a container configuration and attach it to the Pod created earlier,
Copy file name to clipboardExpand all lines: tutorials/debugging.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,17 @@
1
1
# Debugging CRI-O
2
2
3
-
Below is a non-comprehensive document on some tips and tricks for troubleshooting/debugging/inspecting the behavior of CRI-O.
3
+
Below is a non-comprehensive document on some tips and tricks for
4
+
troubleshooting/debugging/inspecting the behavior of CRI-O.
4
5
5
-
### Printing go routines
6
-
Often with a long-running process, it can be useful to know what that process is up to.
6
+
## Printing go routines
7
+
8
+
Often with a long-running process, it can be useful to know what that
9
+
process is up to.
7
10
CRI-O has built-in functionality to print the go routine stacks to provide such information.
8
-
All one has to do is send SIGUSR1 to CRI-O, either with `kill` or `systemctl` (if running CRI-O as a systemd unit):
9
-
```bash
11
+
All one has to do is send SIGUSR1 to CRI-O, either with `kill` or `systemctl`
12
+
(if running CRI-O as a systemd unit):
13
+
14
+
```shell
10
15
kill -USR1 $crio-pid
11
16
systemctl kill -s USR1 crio.service
12
17
```
@@ -15,9 +20,11 @@ CRI-O will catch the signal, and write the routine stacks to `/tmp/crio-goroutin
15
20
16
21
### Forcing Go Garbage Collection
17
22
18
-
You may have a need to manually run Go garbage collection for CRI-O. To force garbage collection, send CRI-O SIGUSR2 using `kill` or `systemctl` (if running CRI-O as a systemd unit).
23
+
You may have a need to manually run Go garbage collection for CRI-O.
24
+
To force garbage collection, send CRI-O SIGUSR2 using `kill` or `systemctl`
0 commit comments