Skip to content

[enterprise-4.4] Add different JSON for ipam static and DHCP configurations #23342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 52 additions & 34 deletions modules/nw-multus-ipam-object.adoc
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@ endif::[]
[id="nw-multus-ipam-object_{context}"]
= Configuration for ipam CNI plug-in

The IP address management (IPAM) Container Network Interface (CNI) plug-in manages IP address assignment for other CNI plug-ins. You can configure ipam for either static IP address assignment or dynamic IP address assignment by using DHCP. The DHCP server you specify must be reachable from the additional network.
The ipam Container Network Interface (CNI) plug-in provides IP address management (IPAM) for other CNI plug-ins.
You can configure ipam for either static IP address assignment or dynamic IP address assignment by using DHCP. The DHCP server you specify must be reachable from the additional network.

ifdef::json[]
The following JSON configuration object describes the parameters that you can set.
@@ -31,65 +32,82 @@ ifdef::yaml[]
The following YAML configuration describes the parameters that you can set.
endif::yaml[]

////
IMPORTANT: If you set the `type` parameter to the `DHCP` value, you cannot set
any other parameters.
////

ifdef::json[]
.ipam CNI plug-in JSON configuration object
[id="nw-multus-static_{context}"]
== Static IP address assignment configuration

The following JSON describes the configuration for static IP address assignment:

.Static assignment configuration
[source,json]
----
{
"ipam": {
"type": "<type>", <1>
"addresses": [ <2>
"type": "static",
"addresses": [ <1>
{
"address": "<address>", <3>
"gateway": "<gateway>" <4>
"address": "<address>", <2>
"gateway": "<gateway>" <3>
}
],
"routes": [ <5>
"routes": [ <4>
{
"dst": "<dst>" <6>
"gw": "<gw>" <7>
"dst": "<dst>" <5>
"gw": "<gw>" <6>
}
],
"dns": { <8>
"nameservers": ["<nameserver>"], <9>
"domain": "<domain>", <10>
"search": ["<search_domain>"] <11>
"dns": { <7>
"nameservers": ["<nameserver>"], <8>
"domain": "<domain>", <9>
"search": ["<search_domain>"] <10>
}
}
}
----
<1> Specify `static` to configure the plug-in to manage IP address assignment.
Specify `DHCP` to allow a DHCP server to manage IP address assignment. You
cannot specify any additional parameters if you specify a value of `DHCP`.

<2> An array describing IP addresses to assign to the virtual interface. Both
<1> An array describing IP addresses to assign to the virtual interface. Both
IPv4 and IPv6 IP addresses are supported.

<3> A block of IP addresses that you specify in CIDR format to assign
to Pods on a worker node, such as `10.1.1.0/24`.
<2> An IP address that you specify.

<4> The default gateway to route egress network traffic to.
<3> The default gateway to route egress network traffic to.

<5> An array describing routes to configure inside the Pod.
<4> An array describing routes to configure inside the Pod.

<6> The IP address range in CIDR format.
<5> The IP address range in CIDR format.

<7> The gateway where network traffic is routed.
<6> The gateway where network traffic is routed.

<8> Optional: DNS configuration.
<7> Optional: DNS configuration.

<9> An of array of one or more IP addresses for to send DNS queries to.
<8> An of array of one or more IP addresses for to send DNS queries to.

<10> The default domain to append to a host name. For example, if the
<9> The default domain to append to a host name. For example, if the
domain is set to `example.com`, a DNS lookup query for `example-host` is
rewritten as `example-host.example.com`.

<11> An array of domain names to append to an unqualified host name,
<10> An array of domain names to append to an unqualified host name,
such as `example-host`, during a DNS lookup query.

[id="nw-multus-dhcp_{context}"]
== Dynamic IP address assignment configuration

The following JSON describes the configuration for dynamic IP address assignment with DHCP:

.DHCP assignment configuration
[source,json]
----
{
"ipam": {
"type": "dhcp"
}
}
----

[id="nw-multus-static-example_{context}"]
== Static IP address assignment configuration example

@@ -109,22 +127,23 @@ You can configure ipam for static IP address assignment:
}
----

[id="nw-multus-dynamic-example_{context}"]
== Dynamic IP address assignment configuration example
[id="nw-multus-dhcp-example_{context}"]
== Dynamic IP address assignment configuration example using DHCP

You can configure ipam for DHCP:

[source,json]
----
{
"ipam": {
"type": "DHCP"
"type": "dhcp"
}
}
----
endif::json[]

// YAML uses collection and mapping to describe arrays and objects
// YAML configuration is only relevant to `simpleMacvlanConfig`
// This is limited by the fields that the CNO accepts

ifdef::yaml[]
.ipam CNI plug-in YAML configuration object
@@ -168,8 +187,7 @@ ipamConfig:
<1> A collection of mappings that define IP addresses to assign to the virtual
interface. Both IPv4 and IPv6 IP addresses are supported.

<2> A block of IP addresses that you specify in CIDR format to assign
to Pods on a worker node, such as `10.1.1.0/24`.
<2> An IP address that you specify.

<3> The default gateway to route egress network traffic to.