You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -146,6 +159,7 @@ Plugins should generally complete a `DEL` action without error even if some reso
146
159
147
160
Runtimes must use the type of network (see [Network Configuration](#network-configuration) below) as the name of the executable to invoke.
148
161
Runtimes should then look for this executable in a list of predefined directories (the list of directories is not prescribed by this specification). Once found, it must invoke the executable using the following environment variables for argument passing:
162
+
149
163
- `CNI_COMMAND`: indicates the desired operation; `ADD`, `DEL`, `CHECK`, or `VERSION`.
150
164
- `CNI_CONTAINERID`: Container ID
151
165
- `CNI_NETNS`: Path to network namespace file
@@ -255,6 +269,8 @@ Plugins may define additional fields that they accept and may generate an error
255
269
256
270
### Example configurations
257
271
272
+
#### Example bridge configuration
273
+
258
274
```jsonc
259
275
{
260
276
"cniVersion": "0.4.0",
@@ -274,6 +290,8 @@ Plugins may define additional fields that they accept and may generate an error
274
290
}
275
291
```
276
292
293
+
#### Example ovs configuration
294
+
277
295
```jsonc
278
296
{
279
297
"cniVersion":"0.4.0",
@@ -295,6 +313,8 @@ Plugins may define additional fields that they accept and may generate an error
295
313
}
296
314
```
297
315
316
+
#### Example macvlan configuration
317
+
298
318
```jsonc
299
319
{
300
320
"cniVersion":"0.4.0",
@@ -317,6 +337,7 @@ Network configuration lists provide a mechanism to run multiple CNI plugins for
317
337
The list is composed of well-known fields and list of one or more standard CNI network configurations (see above).
318
338
319
339
The list is described in JSON form, and can be stored on disk or generated from other sources by the container runtime. The following fields are well-known and have the following meaning:
340
+
320
341
-`cniVersion` (string): [Semantic Version 2.0](https://semver.org) of CNI specification to which this configuration list and all the individual configurations conform.
321
342
-`name` (string): Network name. This should be unique across all containers on the host (or other administrative domain). Must start with a alphanumeric character, optionally followed by any combination of one or more alphanumeric characters, underscore (_), dot (.) or hyphen (-).
322
343
-`disableCheck` (string): Either `true` or `false`. If `disableCheck` is `true`, runtimes must not call `CHECK` for this network configuration list. This allows an administrator to prevent `CHECK`ing where a combination of plugins is known to return spurious errors.
@@ -567,16 +588,16 @@ Note that plugins are executed in reverse order from the `ADD` and `CHECK` actio
567
588
"interfaces": [
568
589
{
569
590
"name": "cni0",
570
-
"mac": "00:11:22:33:44:55",
591
+
"mac": "00:11:22:33:44:55"
571
592
},
572
593
{
573
594
"name": "veth3243",
574
-
"mac": "55:44:33:22:11:11",
595
+
"mac": "55:44:33:22:11:11"
575
596
},
576
597
{
577
598
"name": "eth0",
578
599
"mac": "99:88:77:66:55:44",
579
-
"sandbox": "/var/run/netns/blue",
600
+
"sandbox": "/var/run/netns/blue"
580
601
}
581
602
],
582
603
"dns": {
@@ -768,11 +789,13 @@ The `dns` field contains a dictionary consisting of common DNS information.
768
789
769
790
Error codes 1-99 must not be used other than as specified here.
770
791
771
-
-`1` - Incompatible CNI version
772
-
-`2` - Unsupported field in network configuration. The error message must contain the key and value of the unsupported field.
773
-
-`3` - Container unknown or does not exist. This error implies the runtime does not need to perform any container network cleanup (for example, calling the `DEL` action on the container).
774
-
-`4` - Invalid necessary environment variables, like CNI_COMMAND, CNI_CONTAINERID, etc. The error message must contain the names of invalid variables.
775
-
-`5` - I/O failure. For example, failed to read network config bytes from stdin.
776
-
-`6` - Failed to decode content. For example, failed to unmarshal network config from bytes or failed to decode version info from string.
777
-
-`7` - Invalid network config. If some validations on network configs do not pass, this error will be raised.
778
-
-`11` - Try again later. If the plugin detects some transient condition that should clear up, it can use this code to notify the runtime it should re-try the operation later.
792
+
Error Code|Error Description
793
+
---|---
794
+
`-1`|Incompatible CNI version
795
+
`-2`|Unsupported field in network configuration. The error message must contain the key and value of the unsupported field.
796
+
`-3`|Container unknown or does not exist. This error implies the runtime does not need to perform any container network cleanup (for example, calling the `DEL` action on the container).
797
+
`-4`|Invalid necessary environment variables, like CNI_COMMAND, CNI_CONTAINERID, etc. The error message must contain the names of invalid variables.
798
+
`-5`|I/O failure. For example, failed to read network config bytes from stdin.
799
+
`-6`|Failed to decode content. For example, failed to unmarshal network config from bytes or failed to decode version info from string.
800
+
`-7`|Invalid network config. If some validations on network configs do not pass, this error will be raised.
801
+
`-11`|Try again later. If the plugin detects some transient condition that should clear up, it can use this code to notify the runtime it should re-try the operation later.
0 commit comments