Skip to content

Commit 6f82d01

Browse files
committed
Add different JSON for ipam static and DHCP configurations
- #20630
1 parent 32534b0 commit 6f82d01

File tree

1 file changed

+52
-34
lines changed

1 file changed

+52
-34
lines changed

modules/nw-multus-ipam-object.adoc

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ endif::[]
2121
[id="nw-multus-ipam-object_{context}"]
2222
= Configuration for ipam CNI plug-in
2323

24-
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.
24+
The ipam Container Network Interface (CNI) plug-in provides IP address management (IPAM) for other CNI plug-ins.
25+
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.
2526

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

35+
////
3436
IMPORTANT: If you set the `type` parameter to the `DHCP` value, you cannot set
3537
any other parameters.
38+
////
3639

3740
ifdef::json[]
38-
.ipam CNI plug-in JSON configuration object
41+
[id="nw-multus-static_{context}"]
42+
== Static IP address assignment configuration
43+
44+
The following JSON describes the configuration for static IP address assignment:
45+
46+
.Static assignment configuration
3947
[source,json]
4048
----
4149
{
4250
"ipam": {
43-
"type": "<type>", <1>
44-
"addresses": [ <2>
51+
"type": "static",
52+
"addresses": [ <1>
4553
{
46-
"address": "<address>", <3>
47-
"gateway": "<gateway>" <4>
54+
"address": "<address>", <2>
55+
"gateway": "<gateway>" <3>
4856
}
4957
],
50-
"routes": [ <5>
58+
"routes": [ <4>
5159
{
52-
"dst": "<dst>" <6>
53-
"gw": "<gw>" <7>
60+
"dst": "<dst>" <5>
61+
"gw": "<gw>" <6>
5462
}
5563
],
56-
"dns": { <8>
57-
"nameservers": ["<nameserver>"], <9>
58-
"domain": "<domain>", <10>
59-
"search": ["<search_domain>"] <11>
64+
"dns": { <7>
65+
"nameservers": ["<nameserver>"], <8>
66+
"domain": "<domain>", <9>
67+
"search": ["<search_domain>"] <10>
6068
}
6169
}
6270
}
6371
----
64-
<1> Specify `static` to configure the plug-in to manage IP address assignment.
65-
Specify `DHCP` to allow a DHCP server to manage IP address assignment. You
66-
cannot specify any additional parameters if you specify a value of `DHCP`.
67-
68-
<2> An array describing IP addresses to assign to the virtual interface. Both
72+
<1> An array describing IP addresses to assign to the virtual interface. Both
6973
IPv4 and IPv6 IP addresses are supported.
7074

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

74-
<4> The default gateway to route egress network traffic to.
77+
<3> The default gateway to route egress network traffic to.
7578

76-
<5> An array describing routes to configure inside the Pod.
79+
<4> An array describing routes to configure inside the Pod.
7780

78-
<6> The IP address range in CIDR format.
81+
<5> The IP address range in CIDR format.
7982

80-
<7> The gateway where network traffic is routed.
83+
<6> The gateway where network traffic is routed.
8184

82-
<8> Optional: DNS configuration.
85+
<7> Optional: DNS configuration.
8386

84-
<9> An of array of one or more IP addresses for to send DNS queries to.
87+
<8> An of array of one or more IP addresses for to send DNS queries to.
8588

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

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

96+
[id="nw-multus-dhcp_{context}"]
97+
== Dynamic IP address assignment configuration
98+
99+
The following JSON describes the configuration for dynamic IP address assignment with DHCP:
100+
101+
.DHCP assignment configuration
102+
[source,json]
103+
----
104+
{
105+
"ipam": {
106+
"type": "dhcp"
107+
}
108+
}
109+
----
110+
93111
[id="nw-multus-static-example_{context}"]
94112
== Static IP address assignment configuration example
95113

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

112-
[id="nw-multus-dynamic-example_{context}"]
113-
== Dynamic IP address assignment configuration example
130+
[id="nw-multus-dhcp-example_{context}"]
131+
== Dynamic IP address assignment configuration example using DHCP
114132

115133
You can configure ipam for DHCP:
116134

117135
[source,json]
118136
----
119137
{
120138
"ipam": {
121-
"type": "DHCP"
139+
"type": "dhcp"
122140
}
123141
}
124142
----
125143
endif::json[]
126144

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

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

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

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

0 commit comments

Comments
 (0)