Add documentation for using namespace labels for configuring defaults.
Signed-off-by: Nikhil Soni <krsoninikhil@gmail.com>
This commit is contained in:
parent
34323985a1
commit
da2ab865e0
@ -34,9 +34,7 @@ Filesystem paths, IDs, and other system level resources must be namespaced for a
|
|||||||
|
|
||||||
Simply create a new `context` and set your application's namespace on the `context`.
|
Simply create a new `context` and set your application's namespace on the `context`.
|
||||||
Make sure to use a unique namespace for applications that does not conflict with existing namespaces. The namespaces
|
Make sure to use a unique namespace for applications that does not conflict with existing namespaces. The namespaces
|
||||||
API, or the `ctr namespaces` client command, can be used to query/list and create new namespaces. Note that namespaces
|
API, or the `ctr namespaces` client command, can be used to query/list and create new namespaces.
|
||||||
can have a list of labels associated with the namespace. This can be useful for associating metadata with a particular
|
|
||||||
namespace.
|
|
||||||
|
|
||||||
```go
|
```go
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
@ -49,6 +47,19 @@ var (
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Namespace Labels
|
||||||
|
|
||||||
|
Namespaces can have a list of labels associated with the namespace. This can be useful for associating metadata with a particular namespace.
|
||||||
|
Labels can also be used to configure the defaults for containerd, for example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> sudo ctr namespaces label k8s.io containerd.io/defaults/snapshotter=btrfs
|
||||||
|
> sudo ctr namespaces label k8s.io containerd.io/defaults/runtime=testRuntime
|
||||||
|
```
|
||||||
|
|
||||||
|
This will set the default snapshotter as `btrfs` and runtime as `testRuntime`.
|
||||||
|
Note that currently only these two labels are used to configure the defaults and labels of `default` namespace are not considered for the same.
|
||||||
|
|
||||||
## Inspecting Namespaces
|
## Inspecting Namespaces
|
||||||
|
|
||||||
If we need to inspect containers, images, or other resources in various namespaces the `ctr` tool allows you to do this.
|
If we need to inspect containers, images, or other resources in various namespaces the `ctr` tool allows you to do this.
|
||||||
|
Loading…
Reference in New Issue
Block a user