mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 09:46:53 +01:00
95 lines
2.7 KiB
Plaintext
95 lines
2.7 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * networking/multiple_networks/configuring-host-device.adoc
|
|
|
|
[id="nw-multus-host-device-object_{context}"]
|
|
= Configuration for host-device
|
|
|
|
The configuration for an additional network attachment that uses the host-device
|
|
Container Network Interface (CNI) plug-in is provided in two parts:
|
|
|
|
* Cluster Network Operator (CNO) configuration
|
|
* CNI plug-in configuration
|
|
|
|
The CNO configuration specifies the name for the additional network attachment
|
|
and the namespace to create the attachment in. The plug-in
|
|
is configured by a JSON object specified by the `rawCNIConfig` parameter in
|
|
the CNO configuration.
|
|
|
|
The following YAML describes the configuration parameters for the CNO:
|
|
|
|
.Cluster Network Operator YAML configuration
|
|
[source,yaml]
|
|
----
|
|
name: <name> <1>
|
|
namespace: <namespace> <2>
|
|
rawCNIConfig: '{ <3>
|
|
...
|
|
}'
|
|
type: Raw
|
|
----
|
|
<1> Specify a name for the additional network attachment that you are
|
|
creating. The name must be unique within the specified `namespace`.
|
|
|
|
<2> Specify the namespace to create the network attachment in. If
|
|
you do not specify a value, then the `default` namespace is used.
|
|
|
|
<3> Specify the CNI plug-in configuration in JSON format, which
|
|
is based on the following template.
|
|
|
|
IMPORTANT: Specify your network device by setting only one of the
|
|
following parameters: `device`, `hwaddr`, `kernelpath`, or `pciBusID`.
|
|
|
|
The following object describes the configuration parameters for the host-device CNI
|
|
plug-in:
|
|
|
|
.host-device CNI plug-in JSON configuration object
|
|
[source,json]
|
|
----
|
|
{
|
|
"cniVersion": "0.3.1",
|
|
"name": "<name>", <1>
|
|
"type": "host-device",
|
|
"device": "<device>", <2>
|
|
"hwaddr": "<hwaddr>", <3>
|
|
"kernelpath": "<kernelpath>", <4>
|
|
"pciBusID": "<pciBusID>", <5>
|
|
"ipam": { <6>
|
|
...
|
|
}
|
|
}
|
|
----
|
|
<1> Specify the value for the `name` parameter you provided previously for
|
|
the CNO configuration.
|
|
|
|
<2> Specify the name of the device, such as `eth0`.
|
|
|
|
<3> Specify the device hardware MAC address.
|
|
|
|
<4> Specify the Linux kernel device path, such as
|
|
`/sys/devices/pci0000:00/0000:00:1f.6`.
|
|
|
|
<5> Specify the PCI address of the network device, such as `0000:00:1f.6`.
|
|
|
|
<6> Specify a configuration object for the ipam CNI plug-in. The plug-in
|
|
manages IP address assignment for the attachment definition.
|
|
|
|
[id="nw-multus-hostdev-config-example_{context}"]
|
|
== host-device configuration example
|
|
|
|
The following example configures an additional network named `hostdev-net`:
|
|
|
|
[source,yaml]
|
|
----
|
|
name: hostdev-net
|
|
namespace: work-network
|
|
type: Raw
|
|
rawCNIConfig: '{ <1>
|
|
"cniVersion": "0.3.1",
|
|
"name": "work-network",
|
|
"type": "host-device",
|
|
"device": "eth1"
|
|
}'
|
|
----
|
|
<1> The CNI configuration object is specified as a YAML string.
|