From dfad5728a70f7986a23de6125ddf1449f0d89823 Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Fri, 11 Mar 2022 17:13:58 +0530 Subject: [PATCH] docs: Mention --cni flag while invoking ctr Specify that the `--cni` flag needs to be passed to the `ctr` tool while starting a container in order to have networking enabled for the container. This flag allows containerd to call into the configured network plugin which in turn creates a network interface for the container. Signed-off-by: Archana Shinde --- docs/how-to/containerd-kata.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/how-to/containerd-kata.md b/docs/how-to/containerd-kata.md index 9cd82128dd..5cdac16b98 100644 --- a/docs/how-to/containerd-kata.md +++ b/docs/how-to/containerd-kata.md @@ -312,10 +312,12 @@ To run a container with Kata Containers through the containerd command line, you ```bash $ sudo ctr image pull docker.io/library/busybox:latest -$ sudo ctr run --runtime io.containerd.run.kata.v2 -t --rm docker.io/library/busybox:latest hello sh +$ sudo ctr run --cni --runtime io.containerd.run.kata.v2 -t --rm docker.io/library/busybox:latest hello sh ``` This launches a BusyBox container named `hello`, and it will be removed by `--rm` after it quits. +The `--cni` flag enables CNI networking for the container. Without this flag, a container with just a +loopback interface is created. ### Launch Pods with `crictl` command line