Skip to content

Commit da2ab86

Browse files
committed
Add documentation for using namespace labels for configuring defaults.
Signed-off-by: Nikhil Soni <[email protected]>
1 parent 3432398 commit da2ab86

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

docs/namespaces.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ Filesystem paths, IDs, and other system level resources must be namespaced for a
3434

3535
Simply create a new `context` and set your application's namespace on the `context`.
3636
Make sure to use a unique namespace for applications that does not conflict with existing namespaces. The namespaces
37-
API, or the `ctr namespaces` client command, can be used to query/list and create new namespaces. Note that namespaces
38-
can have a list of labels associated with the namespace. This can be useful for associating metadata with a particular
39-
namespace.
37+
API, or the `ctr namespaces` client command, can be used to query/list and create new namespaces.
4038

4139
```go
4240
ctx := context.Background()
@@ -49,6 +47,19 @@ var (
4947
)
5048
```
5149

50+
## Namespace Labels
51+
52+
Namespaces can have a list of labels associated with the namespace. This can be useful for associating metadata with a particular namespace.
53+
Labels can also be used to configure the defaults for containerd, for example:
54+
55+
```bash
56+
> sudo ctr namespaces label k8s.io containerd.io/defaults/snapshotter=btrfs
57+
> sudo ctr namespaces label k8s.io containerd.io/defaults/runtime=testRuntime
58+
```
59+
60+
This will set the default snapshotter as `btrfs` and runtime as `testRuntime`.
61+
Note that currently only these two labels are used to configure the defaults and labels of `default` namespace are not considered for the same.
62+
5263
## Inspecting Namespaces
5364

5465
If we need to inspect containers, images, or other resources in various namespaces the `ctr` tool allows you to do this.

0 commit comments

Comments
 (0)