<commit_before>// Module included in the following assemblies:
//
// * networking/multiple_networks/configuring-macvlan.adoc

ifeval::["{context}" == "configuring-macvlan-basic"]
:yaml:
endif::[]
// This is necessary for Whereabouts CNI which is JSON-only
ifeval::["{context}" == "configuring-macvlan"]
:json:
endif::[]

// Content duplicated because the callouts are identical
// and must be changed simultaneously if edited. The numbers
// do not easily line up, so the content is duplicated in each section.

[id="nw-multus-macvlan-object_{context}"]
= Configuration for macvlan CNI plug-in

ifdef::json[]
The configuration for an additional network attachment that uses the macvlan
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.

The following object describes the configuration parameters for the macvlan CNI
plug-in:

.macvlan CNI plug-in JSON configuration object
[source,json]
----
{
  "cniVersion": "0.3.1",
  "name": "<name>", <1>
  "type": "macvlan",
  "mode": "<mode>", <2>
  "master": "<master>", <3>
  "mtu": <mtu>, <4>
  "ipam": { <5>
    ...
  }
}
----
<1> Specify a name for the additional network attachment that you are creating. The name must be unique within the specified `namespace`.

<2> Configures traffic visibility on the virtual network. Must be either `bridge`, `passthru`, `private`, or `vepa`. If a value is not provided, the default value is `bridge`.

<3> The ethernet interface to associate with the virtual interface. If a value is not specified, then the host system's primary ethernet interface is used.

<4> Set the maximum transmission unit (MTU) to the specified value. The default value is automatically set by the kernel.

<5> Specify a configuration object for the ipam CNI plug-in. The plug-in manages IP address assignment for the attachment definition.
endif::json[]

ifdef::yaml[]
The following YAML describes the configuration parameters for the macvlan
Container Network Interface (CNI) plug-in:

.macvlan YAML configuration
[source,yaml]
----
name: <name> <1>
namespace: <namespace> <2>
type: SimpleMacvlan
simpleMacvlanConfig:
  master: <master> <3>
  mode: <mode> <4>
  mtu: <mtu> <5>
  ipamConfig: <6>
    ...
----
<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
a value is not specified, the `default` namespace is used.

<3> The ethernet interface to associate with the virtual interface. If
a value for `master` is not specified, then the host system's primary ethernet
interface is used.

<4> Configures traffic visibility on the virtual network. Must be either
`bridge`, `passthru`, `private`, or `vepa`. If a value for `mode` is not
provided, the default value is `bridge`.

<5> Set the maximum transmission unit (MTU) to the specified value. The
default value is automatically set by the kernel.

<6> Specify a configuration object for the ipam CNI plug-in. The
plug-in manages IP address assignment for the attachment definition.
endif::yaml[]

[id="nw-multus-macvlan-config-example_{context}"]
== macvlan configuration example

The following example configures an additional network named `macvlan-net`:

ifdef::yaml[]
[source,yaml]
----
name: macvlan-net
namespace: work-network
type: SimpleMacvlan
simpleMacvlanConfig:
  ipamConfig:
    type: DHCP
----
endif::yaml[]<commit_msg>Include bonded and VLAN interfaces for Multus macvlan<commit_after>// Module included in the following assemblies:
//
// * networking/multiple_networks/configuring-macvlan.adoc

ifeval::["{context}" == "configuring-macvlan-basic"]
:yaml:
endif::[]
// This is necessary for Whereabouts CNI which is JSON-only
ifeval::["{context}" == "configuring-macvlan"]
:json:
endif::[]

// Content duplicated because the callouts are identical
// and must be changed simultaneously if edited. The numbers
// do not easily line up, so the content is duplicated in each section.

[id="nw-multus-macvlan-object_{context}"]
= Configuration for macvlan CNI plug-in

ifdef::json[]
The configuration for an additional network attachment that uses the macvlan
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.

The following object describes the configuration parameters for the macvlan CNI
plug-in:

.macvlan CNI plug-in JSON configuration object
[source,json]
----
{
  "cniVersion": "0.3.1",
  "name": "<name>", <1>
  "type": "macvlan",
  "mode": "<mode>", <2>
  "master": "<master>", <3>
  "mtu": <mtu>, <4>
  "ipam": { <5>
    ...
  }
}
----
<1> Specify a name for the additional network attachment that you are creating. The name must be unique within the specified `namespace`.

<2> Configures traffic visibility on the virtual network. Must be either `bridge`, `passthru`, `private`, or `vepa`. If a value is not provided, the default value is `bridge`.

<3> The ethernet, bonded, or VLAN interface to associate with the virtual interface. If a value is not specified, then the host system's primary ethernet interface is used.

<4> Set the maximum transmission unit (MTU) to the specified value. The default value is automatically set by the kernel.

<5> Specify a configuration object for the ipam CNI plug-in. The plug-in manages IP address assignment for the attachment definition.
endif::json[]

ifdef::yaml[]
The following YAML describes the configuration parameters for the macvlan
Container Network Interface (CNI) plug-in:

.macvlan YAML configuration
[source,yaml]
----
name: <name> <1>
namespace: <namespace> <2>
type: SimpleMacvlan
simpleMacvlanConfig:
  master: <master> <3>
  mode: <mode> <4>
  mtu: <mtu> <5>
  ipamConfig: <6>
    ...
----
<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
a value is not specified, the `default` namespace is used.

<3> The ethernet, bonded, or VLAN interface to associate with the virtual interface. If a value for `master` is not specified, then the host system's primary ethernet interface is used.

<4> Configures traffic visibility on the virtual network. Must be either
`bridge`, `passthru`, `private`, or `vepa`. If a value for `mode` is not
provided, the default value is `bridge`.

<5> Set the maximum transmission unit (MTU) to the specified value. The
default value is automatically set by the kernel.

<6> Specify a configuration object for the ipam CNI plug-in. The
plug-in manages IP address assignment for the attachment definition.
endif::yaml[]

[id="nw-multus-macvlan-config-example_{context}"]
== macvlan configuration example

The following example configures an additional network named `macvlan-net`:

ifdef::yaml[]
[source,yaml]
----
name: macvlan-net
namespace: work-network
type: SimpleMacvlan
simpleMacvlanConfig:
  ipamConfig:
    type: DHCP
----
endif::yaml[]
{'fraction_non_alphanumeric': 0.09864957656214236, 'fraction_numerical': 0.007095445181963836, 'mean_word_length': 4.489321608040201, 'pattern_counts': {'":': 14, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7470966', 'n_tokens_mistral': 2526, 'n_tokens_neox': 2463, 'n_words': 1154}