|
28 | 28 | * [DANM IPAM](#danm-ipam)
|
29 | 29 | * [IPv6 and dual-stack support](#ipv6-and-dual-stack-support)
|
30 | 30 | * [DANM IPVLAN CNI](#danm-ipvlan-cni)
|
| 31 | + * [Device Plugin Support](#device-plugin-support) |
| 32 | + * [Using Intel SR-IOV CNI](#using-intel-sriov-cni) |
31 | 33 | * [Usage of DANM's Netwatcher component](#usage-of-danms-netwatcher-component)
|
32 | 34 | * [Usage of DANM's Svcwatcher component](#usage-of-danms-svcwatcher-component)
|
33 | 35 | * [Feature description](#feature-description)
|
@@ -354,6 +356,78 @@ The CNI provisions IPVLAN interfaces in L2 mode, and supports the following extr
|
354 | 356 | * allocating IP addresses by using DANM's flexible, in-built IPAM module
|
355 | 357 | * provisioning generic IP routes into a configured routing table inside the Pod's network namespace
|
356 | 358 | * Pod-level controlled provisioning of policy-based IP routes into Pod's network namespace
|
| 359 | +#### Device Plugin support |
| 360 | +DANM provides general support to CNIs which interwork with Kubernetes' Device Plugin mechanism such as SR-IOV CNI. |
| 361 | +When a properly configured Network Device Plugin runs, the allocatable resource list for the node should be updated with resource discovered by the plugin. |
| 362 | +##### Using Intel SR-IOV CNI |
| 363 | +SR-IOV Network Device Plugin allows to create a list of *netdevice* type resource definitions with *sriovMode*, where each resource definition can have one or more assigned *rootDevice* (Physical Function). The plugin looks for Virtual Funtions (VF) for each configured Physical Function (PF) and adds all discovered VF to the allocatable resource's list of the given Kubernetes Node. The Device Plugin resource name will be the device pool name on the Node. These device pools can be referred in Pod definition's resource request part on the usual way. |
| 364 | + |
| 365 | +In the following example, the "nokia.k8s.io/sriov_ens1f0" device pool name consists of the "nokia.k8s.io" prefix and "sriov_ens1f0" resourceName. |
| 366 | + |
| 367 | +For more information consult the plugin's users guide. |
| 368 | +``` |
| 369 | +kubectl get nodes 172.30.101.104 -o json | jq '.status.allocatable' |
| 370 | +{ |
| 371 | + "cpu": "48", |
| 372 | + "ephemeral-storage": "48308001098", |
| 373 | + "hugepages-1Gi": "16Gi", |
| 374 | + "memory": "246963760Ki", |
| 375 | + "nokia.k8s.io/default": "0", |
| 376 | + "nokia.k8s.io/sriov_ens1f0": "8", |
| 377 | + "nokia.k8s.io/sriov_ens1f1": "8", |
| 378 | + "pods": "110" |
| 379 | +} |
| 380 | +``` |
| 381 | +DanmNet's schema definition contains an optional device_pool field where a specific device pool can be assigned to the given DanmNet. |
| 382 | +Before DANM invokes a CNI which expects a given resource to be attached to the Pod, it gathers all available device IDs from the DanmNet's device pool and passes one ID from the list to the CNI. |
| 383 | + |
| 384 | +The following DanmNet definition shows how to configure device_pool parameter for sriov network type. |
| 385 | +``` |
| 386 | +apiVersion: danm.k8s.io/v1 |
| 387 | +kind: DanmNet |
| 388 | +metadata: |
| 389 | + name: sriov-a |
| 390 | + namespace: example-sriov |
| 391 | +spec: |
| 392 | + NetworkID: sriov-a |
| 393 | + NetworkType: sriov |
| 394 | + Options: |
| 395 | + host_device: ens1f0 |
| 396 | + device_pool: "nokia.k8s.io/sriov_ens1f0" |
| 397 | +``` |
| 398 | +The following Pod definition shows how to create resource request for each sriov type DanmNet. |
| 399 | +``` |
| 400 | +apiVersion: v1 |
| 401 | +kind: Pod |
| 402 | +metadata: |
| 403 | + name: sriov-pod |
| 404 | + namespace: example-sriov |
| 405 | + labels: |
| 406 | + env: test |
| 407 | + annotations: |
| 408 | + danm.k8s.io/interfaces: | |
| 409 | + [ |
| 410 | + {"network":"management", "ip":"dynamic"}, |
| 411 | + {"network":"sriov-a", "ip":"none"}, |
| 412 | + {"network":"sriov-b", "ip":"none"} |
| 413 | + ] |
| 414 | +spec: |
| 415 | + containers: |
| 416 | + - name: sriov-pod |
| 417 | + image: busybox:latest |
| 418 | + args: |
| 419 | + - sleep |
| 420 | + - "1000" |
| 421 | + resources: |
| 422 | + requests: |
| 423 | + nokia.k8s.io/sriov_ens1f0: '1' |
| 424 | + nokia.k8s.io/sriov_ens1f1: '1' |
| 425 | + limits: |
| 426 | + nokia.k8s.io/sriov_ens1f0: '1' |
| 427 | + nokia.k8s.io/sriov_ens1f1: '1' |
| 428 | + nodeSelector: |
| 429 | + sriov: enabled |
| 430 | +``` |
357 | 431 |
|
358 | 432 | ### Usage of DANM's Netwatcher component
|
359 | 433 | Netwatcher is a mandatory component of the DANM networking suite.
|
|
0 commit comments