-
Notifications
You must be signed in to change notification settings - Fork 8
Description
This issue is for tracking an issue to integrate capability of multi-nic-cni to the upstream Kubernetes community.
What will be migrated to CNI DRA driver?
- daemon/iface capability to discover network interfaces
- daemon/selector capability to select network by policy
- cni/multi-nic-cni capability to dynamic configure content based on selected host and interface
- workarounds on sriov, ipvlan, macvlan, host-device willl be removed
What needs to address separately?
- host-local-ipam CIDR computation and route configuration for IPVLAN L3
- multi-gateway CNI to meta CNI PR to https://github.com/containernetworking/plugins/tree/main/plugins/meta
- aws-ipvlan-iapm to generic vpc-ipam PR to https://github.com/containernetworking/plugins/tree/main/plugins/ipam
More detail about how these capabilities can be migrated:
Discover and select network interfaces
- use DRA with CEL, prioritized alternatives ,and consumable capcity.
Dynamic configuration
configure IP address of Pod network corresponding on selected network interface.
Currently, it call multi-nic-cni-ipam with a set of configurations instead of single configuration and replace IPs with static IPAM for each configuration. For host-device-ipam, it get host IP from device directly.
With DRA, CNI DRA driver may include the following parameters in the resource claim template and apply the template values with the scheduled node and allocated interfaces.
template: |
{
"cniVersion": "0.4.0",
"name": "macvlan-network",
"type": "macvlan",
"master": "{{ .interface.name }}",
"mode": "bridge",
"ipam": {
"type": "host-local",
"subnet": "{{ .host.interface.subnet }}",
"rangeStart": "{{ .host.interface.rangeStart }}",
"rangeEnd": "{{ .host.interface.rangeEnd }}",
"routes": [
{ "dst": "0.0.0.0/0" }
],
"gateway": "{{ .host.interface.gateway }}"
}
}
hostConfigs:
default:
- subnet: "192.168.100.0/24"
- gateway: "192.168.100.1"
hosts:
- name: worker1
interfaces:
- selector: |
name == "eth1"
subnet: "192.168.100.0/24"
rangeStart: "192.168.100.100"
rangeEnd: "192.168.100.200"
- selector: |
name == "eth2"
subnet: "192.168.200.0/24"
rangeStart: "192.168.200.100"
rangeEnd: "192.168.200.200"
gateway: "192.168.200.1"
- name: worker2
default:
subnet: "192.168.100.0/24"
rangeStart: "192.168.100.201"
rangeEnd: "192.168.100.240"
- name: worker3
default:
subnet: "192.168.200.0/24"
rangeStart: "192.168.200.201"
rangeEnd: "192.168.200.240"
gateway: "192.168.200.1"- let interface contains common attributes such as
name,pciAddress,macAddress,ipv4,ipv6,ipv4NetworkAddress.
Requirements on CNI DRA Driver
How CNI or CNI daemon can interact with the driver?
- API to list ResourceSlices Device called by driver (once or period or by-demand)
- API (CR) to share information from CNI daemon preparation operation that needs to provide information based on existence of nodes (such as host-interface-local IPAM). For example, the template above.
- Logic to parse config from ResourceClaim to CNI that supports using template to fill dynamic value such as interface name or host/interface-dependent configuration.
Note:
I have started drafting the proposal here:
https://github.com/sunya-ch/cni-dra-driver/blob/multi-nic-cni-integration/docs/proposal/multi-nic-cni-integration.md