|
1 | | -# nri - Node Resource Interface |
2 | | - |
3 | | -*This version of NRI is supported through the included v010-adapter plugin.* |
4 | | - |
5 | | -This project is a WIP for a new, CNI like, interface for managing resources on a node for Pods and Containers. |
6 | | - |
7 | | -## Documentation |
8 | | - |
9 | | -The basic interface, concepts and plugin design of the Container Network Interface (CNI) is an elegant way to handle multiple implementations of the network stack for containers. |
10 | | -This concept can be used for additional interfaces to customize a container's runtime environment. |
11 | | -This proposal covers a new interface for resource management on a node with a structured API and plugin design for containers. |
12 | | - |
13 | | -## Lifecycle |
14 | | - |
15 | | -The big selling point for CNI is that it has a structured interface for modifying the network namespace for a container. |
16 | | -This is different from generic hooks as they lack a type safe API injected into the lifecycle of a container. |
17 | | -The lifecycle point that CNI and NRI plugins will be injected into is the point between `Create` and `Start` of the container's init process. |
18 | | - |
19 | | -`Create->NRI->Start` |
20 | | - |
21 | | -## Configuration |
22 | | - |
23 | | -Configuration is split into two parts. One is the payload that is specific to a plugin invocation while the second is the host level configuration and options that specify what plugins to run and provide additional configuration to a plugin. |
24 | | - |
25 | | -### Filepath and Binaries |
26 | | - |
27 | | -Plugin binary paths can be configured via the consumer but will default to `/opt/nri/bin`. |
28 | | -Binaries are named with their type as the binary name, same as the CNI plugin naming scheme. |
29 | | - |
30 | | -### Host Level Config |
31 | | - |
32 | | -The config's default location will be `/etc/nri/resource.d/*.conf`. |
33 | | - |
34 | | -```json |
35 | | -{ |
36 | | - "version": "0.1", |
37 | | - "plugins": [ |
38 | | - { |
39 | | - "type": "konfine", |
40 | | - "conf": { |
41 | | - "systemReserved": [0, 1] |
42 | | - } |
43 | | - }, |
44 | | - { |
45 | | - "type": "clearcfs" |
46 | | - } |
47 | | - ] |
48 | | -} |
49 | | -``` |
50 | | - |
51 | | -### Input |
52 | | - |
53 | | -Input to a plugin is provided via `STDIN` as a `json` payload. |
54 | | - |
55 | | -```json |
56 | | -{ |
57 | | - "version": "0.1", |
58 | | - "state": "create", |
59 | | - "id": "redis", |
60 | | - "pid": 1234, |
61 | | - "spec": { |
62 | | - "resources": {}, |
63 | | - "cgroupsPath": "default/redis", |
64 | | - "namespaces": { |
65 | | - "pid": "/proc/44/ns/pid", |
66 | | - "mount": "/proc/44/ns/mnt", |
67 | | - "net": "/proc/44/ns/net" |
68 | | - }, |
69 | | - "annotations": { |
70 | | - "qos.class": "ls" |
71 | | - } |
72 | | - } |
73 | | -} |
74 | | -``` |
75 | | - |
76 | | -### Output |
77 | | - |
78 | | -```json |
79 | | -{ |
80 | | - "version": "0.1", |
81 | | - "state": "create", |
82 | | - "id": "redis", |
83 | | - "pid": 1234, |
84 | | - "cgroupsPath": "qos-ls/default/redis" |
85 | | -} |
86 | | -``` |
87 | | - |
88 | | -## Commands |
89 | | - |
90 | | -* Invoke - provides invocations into different lifecycle changes of a container |
91 | | - - states: `setup|pause|resume|update|delete` |
92 | | - |
93 | | -## Packages |
94 | | - |
95 | | -A Go based API and client package will be created for both producers of plugins and consumers, commonly being the container runtime (containerd). |
96 | | - |
97 | | -### Sample Plugin |
98 | | - |
99 | | -* [clearcfs](examples/clearcfs/main.go) |
100 | | - |
101 | | -## Project details |
102 | | - |
103 | | -nri is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). |
104 | | -As a containerd sub-project, you will find the: |
105 | | - |
106 | | - * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), |
107 | | - * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), |
108 | | - * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) |
109 | | - |
110 | | -information in our [`containerd/project`](https://github.com/containerd/project) repository. |
| 1 | +original v0.1.0 CLI invoke style version of NRI has been moved |
| 2 | +[v0.1.0 docs](/plugins/v010-adapter/0.1.0/README.md) |
0 commit comments