|
1 | 1 | # Container Runtime Interface (CRI) CLI
|
2 | 2 |
|
3 |
| -crictl provides a CLI for CRI-compatible container runtimes. This allows the CRI runtime developers to debug their runtime without needing to set up Kubernetes components. |
| 3 | +`crictl` provides a CLI for CRI-compatible container runtimes. This allows the CRI runtime developers to debug their runtime without needing to set up Kubernetes components. |
4 | 4 |
|
5 |
| -crictl is currently in Beta and still under quick iterations. It is hosted at the [cri-tools](https://github.com/kubernetes-sigs/cri-tools) repository. We encourage the CRI developers to report bugs or help extend the coverage by adding more functionalities. |
| 5 | +`crictl` is currently in Beta and still under quick iterations. It is hosted at the [cri-tools](https://github.com/kubernetes-sigs/cri-tools) repository. We encourage the CRI developers to report bugs or help extend the coverage by adding more functionalities. |
6 | 6 |
|
7 | 7 | ## Install crictl
|
8 | 8 |
|
@@ -31,7 +31,7 @@ rm -f crictl-$VERSION-linux-amd64.tar.gz
|
31 | 31 | ## Usage
|
32 | 32 |
|
33 | 33 | ```sh
|
34 |
| -crictl [global options] command [command options] [arguments...] |
| 34 | +crictl [global options] command [command options] [arguments...] |
35 | 35 | ```
|
36 | 36 |
|
37 | 37 | COMMANDS:
|
@@ -60,14 +60,14 @@ COMMANDS:
|
60 | 60 | - `stop`: Stop one or more running containers
|
61 | 61 | - `stopp`: Stop one or more running pods
|
62 | 62 | - `update`: Update one or more running containers
|
63 |
| -- `config`: Get and set crictl client configuration options |
| 63 | +- `config`: Get and set `crictl` client configuration options |
64 | 64 | - `stats`: List container(s) resource usage statistics
|
65 | 65 | - `statsp`: List pod(s) resource usage statistics
|
66 | 66 | - `completion`: Output bash shell completion code
|
67 | 67 | - `checkpoint`: Checkpoint one or more running containers
|
68 | 68 | - `help, h`: Shows a list of commands or help for one command
|
69 | 69 |
|
70 |
| -crictl by default connects on Unix to: |
| 70 | +`crictl` by default connects on Unix to: |
71 | 71 |
|
72 | 72 | - `unix:///var/run/dockershim.sock` or
|
73 | 73 | - `unix:///run/containerd/containerd.sock` or
|
@@ -136,46 +136,49 @@ via sudo (`sudo -E crictl ...`).
|
136 | 136 |
|
137 | 137 | ## Additional options
|
138 | 138 |
|
139 |
| -- `--timeout`, `-t`: Timeout of connecting to server in seconds (default: 2s). |
| 139 | +- `--timeout`, `-t`: Timeout of connecting to server in seconds (default: `2s`). |
140 | 140 | 0 or less is interpreted as unset and converted to the default. There is no
|
141 | 141 | option for no timeout value set and the smallest supported timeout is `1s`
|
142 | 142 | - `--debug`, `-D`: Enable debug output
|
143 | 143 | - `--help`, `-h`: show help
|
144 |
| -- `--version`, `-v`: print the version information of crictl |
145 |
| -- `--config`, `-c`: Location of the client config file. If not specified and the default does not exist, the program's directory is searched as well (default: "/etc/crictl.yaml") [$CRI_CONFIG_FILE] |
| 144 | +- `--version`, `-v`: print the version information of `crictl` |
| 145 | +- `--config`, `-c`: Location of the client config file (default: `/etc/crictl.yaml`). Can be changed by setting `CRI_CONFIG_FILE` environment variable. If not specified and the default does not exist, the program's directory is searched as well |
146 | 146 |
|
147 | 147 | ## Client Configuration Options
|
148 |
| -Use the crictl config command to get and set the crictl client configuration |
| 148 | + |
| 149 | +Use the `crictl` config command to get and set the `crictl` client configuration |
149 | 150 | options.
|
150 |
| -``` |
| 151 | + |
151 | 152 | USAGE:
|
152 |
| - crictl config [command options] [<crictl options>] |
153 |
| -``` |
154 |
| -For example `crictl config --set debug=true` will enable debug mode when giving subsequent crictl commands. |
155 | 153 |
|
156 |
| -CRICTL OPTIONS: |
| 154 | +```sh |
| 155 | +crictl config [command options] [<crictl options>] |
157 | 156 | ```
|
158 |
| - runtime-endpoint: Container runtime endpoint |
159 |
| - image-endpoint: Image endpoint |
160 |
| - timeout: Timeout of connecting to server (default: 2s) |
161 |
| - debug: Enable debug output (default: false) |
162 |
| - pull-image-on-create: Enable pulling image on create requests (default: false) |
163 |
| - disable-pull-on-run: Disable pulling image on run requests (default: false) |
164 | 157 |
|
165 |
| -``` |
166 |
| -OPTIONS: |
167 |
| -``` |
168 |
| - --get value show the option value |
169 |
| - --set value set option (can specify multiple or separate values with commas: opt1=val1,opt2=val2) |
170 |
| - --help, -h show help (default: false) |
171 |
| -``` |
| 158 | +For example `crictl config --set debug=true` will enable debug mode when giving subsequent `crictl` commands. |
| 159 | + |
| 160 | +COMMAND OPTIONS: |
| 161 | + |
| 162 | +- `--get value`: Show the option value |
| 163 | +- `--set value`: Set option (can specify multiple or separate values with commas: opt1=val1,opt2=val2) |
| 164 | +- `--help`, `-h`: Show help (default: `false`) |
| 165 | + |
| 166 | +`crictl` OPTIONS: |
| 167 | + |
| 168 | +- `runtime-endpoint`: Container runtime endpoint (no default value) |
| 169 | +- `image-endpoint`: Image endpoint (no default value) |
| 170 | +- `timeout`: Timeout of connecting to server (default: `2s`) |
| 171 | +- `debug`: Enable debug output (default: `false`) |
| 172 | +- `pull-image-on-create`: Enable pulling image on create requests (default: `false`) |
| 173 | +- `disable-pull-on-run`: Disable pulling image on run requests (default: `false`) |
| 174 | + |
172 | 175 | > When enabled `pull-image-on-create` modifies the create container command to first pull the container's image.
|
173 | 176 | This feature is used as a helper to make creating containers easier and faster.
|
174 | 177 | Some users of `crictl` may desire to not pull the image necessary to create the container.
|
175 |
| -For example, the image may have already been pulled or otherwise loaded into the container runtime, or the user may be running without a network. For this reason the default for `pull-image-on-create` is false. |
| 178 | +For example, the image may have already been pulled or otherwise loaded into the container runtime, or the user may be running without a network. For this reason the default for `pull-image-on-create` is `false`. |
176 | 179 |
|
177 |
| -> By default the run command first pulls the container image, and `disable-pull-on-run` is false. |
178 |
| -Some users of `crictl` may desire to set `disable-pull-on-run` to true to not pull the image by default when using the run command. |
| 180 | +> By default the run command first pulls the container image, and `disable-pull-on-run` is `false`. |
| 181 | +Some users of `crictl` may desire to set `disable-pull-on-run` to `true` to not pull the image by default when using the run command. |
179 | 182 |
|
180 | 183 | > To override these default pull configuration settings, `--no-pull` and `--with-pull` options are provided for the create and run commands.
|
181 | 184 |
|
@@ -209,7 +212,7 @@ POD ID CREATED STATE NAME
|
209 | 212 | f84dd361f8dc5 17 seconds ago Ready nginx-sandbox default 1
|
210 | 213 | ```
|
211 | 214 |
|
212 |
| -#### Run pod sandbox with runtime handler |
| 215 | +### Run pod sandbox with runtime handler |
213 | 216 |
|
214 | 217 | Runtime handler requires runtime support. The following example shows running a pod sandbox with `runsc` handler on containerd runtime.
|
215 | 218 |
|
|
0 commit comments