Multus Network Attachment Definition¶
Network Attachment Definition is a Multus configuration resource to attach underlay network (SF) to the Kubernetes pod (TMM).
Create a
net-attach-def.yaml
with the contents below:vi net-attach-def.yaml
Important: Make sure to update the Resource Name as per your network configurations (see Install the SRIOV CNI Plugin) in the below example.
Example Contents:
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: sf-external annotations: k8s.v1.cni.cncf.io/resourceName: nvidia.com/bf3_p0_sf spec: config: '{ "type": "sf", "cniVersion": "0.3.1", "name": "sf-external", "logLevel": "debug", "logFile": "/tmp/sf-external.log" }' --- apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: sf-internal annotations: k8s.v1.cni.cncf.io/resourceName: nvidia.com/bf3_p1_sf spec: config: '{ "type": "sf", "cniVersion": "0.3.1", "name": "sf-internal", "logLevel": "debug", "logFile": "/tmp/sf-internal.log" }'
Create the Network Attachment Definition custom resource in
default
namespace or a namespace of your choosing.kubectl apply –f net-attach-def.yaml -n default
Multus Network Attachment Definition Parameters¶
The table below describes the spec.networkAttachment
parameters.
Parameter | Description |
---|---|
config.cniVersion string |
Specifies the version of the CNI (Container Network Interface) used for networking within a Kubernetes. |
config.ipam.gateway string |
Specifies the gateway IP address for the network managed by the IP Address Management (IPAM) system. |
config.ipam.rangeEnd string |
Specifies the last IP address available for the network. |
config.ipam.rangeStart string |
Specifies the first IP address available for the network. |
config.ipam.routes.dst string |
Specifies the destination IP address for a route. |
config.ipam.subnet string |
Specifies the subnet (IP address range) for the network. |
config.ipam.type string |
Specifies the type of network configuration. |
config.name string |
Specifies the name of the network configuration. |
config.pciBusID string |
Specifies the PCI (Peripheral Component Interconnect) Bus ID of the network device (such as a network interface card or SR-IOV device) that will be used for the network attachment. |
config.type string |
Specifies the type of network attachment or the network plugin being used. |
name string |
Specifies the name of the network attachment. Match applied netAttachments in same namespace as infra/instance. |
namespace string |
Specifies the namespace where the network configuration is defined, ensuring that the correct network setup is applied to the pod or container. Not required if applied to correct namespace. |