Skip to content

Commit c2d94ad

Browse files
authored
Merge pull request #30598 from mikemckiernan/bz-host-dev-ipam
BZ:1771730 Add IPAM to host-device example
2 parents 5db16f9 + d940676 commit c2d94ad

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

modules/nw-multus-create-network.adoc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ spec:
111111
"type": "static",
112112
"addresses": [
113113
{
114-
"address": "191.168.1.23/24"
114+
"address": "192.168.1.23/24"
115115
}
116116
]
117117
}
@@ -134,7 +134,15 @@ spec:
134134
"cniVersion": "0.3.1",
135135
"name": "test-network-1",
136136
"type": "{plugin}",
137-
"device": "eth1"
137+
"device": "eth1",
138+
"ipam": {
139+
"type": "static",
140+
"addresses": [
141+
{
142+
"address": "192.168.1.23/24"
143+
}
144+
]
145+
}
138146
}'
139147
----
140148
endif::[]
@@ -160,7 +168,7 @@ spec:
160168
"type": "static",
161169
"addresses": [
162170
{
163-
"address": "191.168.1.23/24"
171+
"address": "192.168.1.23/24"
164172
}
165173
]
166174
}
@@ -188,7 +196,7 @@ spec:
188196
"type": "static",
189197
"addresses": [
190198
{
191-
"address": "191.168.1.23/24"
199+
"address": "192.168.1.23/24"
192200
}
193201
]
194202
}

modules/nw-multus-host-device-object.adoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ The following YAML describes the configuration parameters for the CNO:
2424
name: <name> <1>
2525
namespace: <namespace> <2>
2626
rawCNIConfig: '{ <3>
27-
...
27+
...
2828
}'
2929
type: Raw
3030
----
3131
<1> Specify a name for the additional network attachment that you are
3232
creating. The name must be unique within the specified `namespace`.
3333

3434
<2> Specify the namespace to create the network attachment in. If
35-
you do not specify a value, then the `default` namespace is used.
35+
you do not specify a value, the `default` namespace is used.
3636

3737
<3> Specify the CNI plug-in configuration in JSON format, which
3838
is based on the following template.
@@ -43,6 +43,7 @@ following parameters: `device`, `hwaddr`, `kernelpath`, or `pciBusID`.
4343
The following object describes the configuration parameters for the host-device CNI
4444
plug-in:
4545

46+
// containernetworking/plugins/.../host-device.go#L50
4647
.host-device CNI plug-in JSON configuration object
4748
[source,json]
4849
----
@@ -54,7 +55,7 @@ plug-in:
5455
"hwaddr": "<hwaddr>", <3>
5556
"kernelpath": "<kernelpath>", <4>
5657
"pciBusID": "<pciBusID>", <5>
57-
"ipam": { <6>
58+
"ipam": { <6>
5859
...
5960
}
6061
}
@@ -88,7 +89,10 @@ rawCNIConfig: '{ <1>
8889
"cniVersion": "0.3.1",
8990
"name": "work-network",
9091
"type": "host-device",
91-
"device": "eth1"
92+
"device": "eth1",
93+
"ipam": {
94+
"type": "dhcp"
95+
}
9296
}'
9397
----
9498
<1> The CNI configuration object is specified as a YAML string.

networking/multiple_networks/configuring-host-device.adoc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ include::modules/common-attributes.adoc[]
55

66
toc::[]
77

8-
As a cluster administrator, you can configure an additional network for your
9-
cluster by using the host-device Container Network Interface (CNI) plug-in. The
10-
plug-in allows you to move the specified network device from the host's network
11-
namespace into the Pod's network namespace.
8+
As a cluster administrator, you can configure an additional network for your cluster by using the host-device Container Network Interface (CNI) plug-in. The plug-in moves the specified network device from the network namespace of the host into the network namespace of the pod.
129

1310
include::modules/nw-multus-create-network.adoc[leveloffset=+1]
1411
include::modules/nw-multus-host-device-object.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)