Skip to content

Commit fe2ca14

Browse files
authored
Merge pull request linuxkit#3564 from deitch/containerd-opts
multiple containerd options
2 parents 9f1825f + 863e8c7 commit fe2ca14

File tree

125 files changed

+5002
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+5002
-118
lines changed

docs/faq.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Please open an issue if you want to add a question here.
66

77
LinuxKit does not require being installed on a disk, it is often run from an ISO, PXE or other
88
such means, so it does not require an on disk upgrade method such as the ChromeOS code that
9-
is often used. It would definitely be possible to use that type of upgrade method if the
9+
is often used. It would definitely be possible to use that type of upgrade method if the
1010
system is installed, and it would be useful to support this for that use case, and an
1111
updater container to control this for people who want to use this.
1212

@@ -37,18 +37,41 @@ If you're not seeing `containerd` logs in the console during boot, make sure tha
3737

3838
`init` and other processes like `containerd` will use the last defined console in the kernel `cmdline`. When using `qemu`, to see the console you need to list `ttyS0` as the last console to properly see the output.
3939

40-
## Enabling debug or trace log levels on containerd
40+
## Enabling and controlling containerd logs
4141

42-
On startup, linuxkit looks for and parses a file `/etc/containerd/cli-opts`. If it exists, the content is used as arguments to containerd. Thus, to enable
42+
On startup, linuxkit looks for and parses a file `/etc/containerd/runtime-config.toml`. If it exists, the content is used to configure containerd runtime.
43+
44+
Sample config is below:
45+
46+
```toml
47+
cliopts="--log-level debug"
48+
stderr="/var/log/containerd.out.log"
49+
stdout="stdout"
50+
```
51+
52+
The options are as follows:
53+
54+
* `cliopts`: options to pass to the containerd command-line as is.
55+
* `stderr`: where to send stderr from containerd. If blank, it sends it to the default stderr, which is the console.
56+
* `stdout`: where to send stdout from containerd. If blank, it sends it to the default stdout, which is the console. containerd normally does not have any stdout.
57+
58+
The `stderr` and `stdout` options can take exactly one of the following options:
59+
60+
* `stderr` - send to stderr
61+
* `stdout` - send to stdout
62+
* any absolute path (beginning with `/`) - send to that file. If the file exists, append to it; if not, create it and append to it.
63+
64+
Thus, to enable
4365
a higher log level, for example `debug`, create a file whose contents are `--log-level debug` and place it on the image:
4466

4567
```yml
4668
files:
47-
- path: /etc/containerd/cli-opts
48-
contents: "--log-level debug"
69+
- path: /etc/containerd/runtime-config.toml
70+
source: "/path/to/runtime-config.toml"
71+
mode: "0644"
4972
```
5073
51-
Note that the package that parses the contents splits on _all_ whitespace. It does not, as of this writing, support shell-like parsing, so the following will work:
74+
Note that the package that parses the `cliopts` splits on _all_ whitespace. It does not, as of this writing, support shell-like parsing, so the following will work:
5275

5376
```
5477
--log-level debug --arg abcd

examples/addbinds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kernel:
22
image: linuxkit/kernel:5.4.30
33
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
44
init:
5-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
5+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
66
- linuxkit/runc:f79954950022fea76b8b6f10de58cb48e4fb3878
77
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
88
- linuxkit/ca-certificates:abfc6701b9ca17e34ac9439ce5946a247e720ff5

examples/aws.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kernel:
22
image: linuxkit/kernel:5.4.39
33
cmdline: "console=ttyS0"
44
init:
5-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
5+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
66
- linuxkit/runc:v0.8
77
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
88
- linuxkit/ca-certificates:v0.8

examples/azure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kernel:
22
image: linuxkit/kernel:5.4.39
33
cmdline: "console=ttyS0"
44
init:
5-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
5+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
66
- linuxkit/runc:v0.8
77
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
88
- linuxkit/ca-certificates:v0.8

examples/cadvisor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kernel:
22
image: linuxkit/kernel:5.4.39
33
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
44
init:
5-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
5+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
66
- linuxkit/runc:v0.8
77
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
88
- linuxkit/ca-certificates:v0.8

examples/dm-crypt-loop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kernel:
22
image: linuxkit/kernel:5.4.39
33
cmdline: "console=tty0 console=ttyS0"
44
init:
5-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
5+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
66
- linuxkit/runc:v0.8
77
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
88
- linuxkit/ca-certificates:v0.8

examples/dm-crypt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kernel:
22
image: linuxkit/kernel:5.4.39
33
cmdline: "console=tty0 console=ttyS0"
44
init:
5-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
5+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
66
- linuxkit/runc:v0.8
77
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
88
- linuxkit/ca-certificates:v0.8

examples/docker-for-mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kernel:
44
cmdline: "console=ttyS0 page_poison=1"
55
init:
66
- linuxkit/vpnkit-expose-port:v0.8 # install vpnkit-expose-port and vpnkit-iptables-wrapper on host
7-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
7+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
88
- linuxkit/runc:v0.8
99
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
1010
- linuxkit/ca-certificates:v0.8

examples/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kernel:
22
image: linuxkit/kernel:5.4.39
33
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0 console=ttysclp0"
44
init:
5-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
5+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
66
- linuxkit/runc:v0.8
77
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
88
- linuxkit/ca-certificates:v0.8

examples/gcp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kernel:
22
image: linuxkit/kernel:5.4.39
33
cmdline: "console=ttyS0"
44
init:
5-
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
5+
- linuxkit/init:a68f9fa0c1d9dbfc9c23663749a0b7ac510cbe1c
66
- linuxkit/runc:v0.8
77
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
88
- linuxkit/ca-certificates:v0.8

0 commit comments

Comments
 (0)