Skip to content

Commit 5baed55

Browse files
authored
Merge pull request #71081 from kquinn1204/OCPBUGS-27961
OCPBUGS-27961 Procedure for configuring Whereabouts IP reconciler schedule
2 parents b08769e + 9fc4e4c commit 5baed55

4 files changed

+160
-72
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/multiple_networks/configuring-additional-network.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
7+
[id="nw-multus-configuring-whereabouts-ip-reconciler-schedule_{context}"]
8+
= Configuring the Whereabouts IP reconciler schedule
9+
10+
The Whereabouts IPAM CNI plugin runs the IP reconciler daily. This process cleans up any stranded IP allocations that might result in exhausting IPs and therefore prevent new pods from getting an IP allocated to them.
11+
12+
Use this procedure to change the frequency at which the IP reconciler runs.
13+
14+
.Prerequisites
15+
* You installed the OpenShift CLI (`oc`).
16+
* You have access to the cluster as a user with the `cluster-admin` role.
17+
* You have deployed the `whereabouts-reconciler` daemon set, and the `whereabouts-reconciler` pods are up and running.
18+
19+
.Procedure
20+
21+
. Run the following command to create a `ConfigMap` object named `whereabouts-config` in the `openshift-multus` namespace with a specific cron expression for the IP reconciler:
22+
+
23+
[source,terminal]
24+
----
25+
$ oc create configmap whereabouts-config -n openshift-multus --from-literal=reconciler_cron_expression="*/15 * * * *"
26+
----
27+
+
28+
This cron expression indicates the IP reconciler runs every 15 minutes. Adjust the expression based on your specific requirements.
29+
+
30+
[NOTE]
31+
====
32+
The `whereabouts-reconciler` daemon set can only consume a cron expression pattern that includes five asterisks. The sixth, which is used to denote seconds, is currently not supported.
33+
====
34+
35+
. Retrieve information about resources related to the `whereabouts-reconciler` daemon set and pods within the `openshift-multus` namespace by running the following command:
36+
+
37+
[source,terminal]
38+
----
39+
$ oc get all -n openshift-multus | grep whereabouts-reconciler
40+
----
41+
+
42+
.Example output
43+
+
44+
[source,terminal]
45+
----
46+
pod/whereabouts-reconciler-2p7hw 1/1 Running 0 4m14s
47+
pod/whereabouts-reconciler-76jk7 1/1 Running 0 4m14s
48+
pod/whereabouts-reconciler-94zw6 1/1 Running 0 4m14s
49+
pod/whereabouts-reconciler-mfh68 1/1 Running 0 4m14s
50+
pod/whereabouts-reconciler-pgshz 1/1 Running 0 4m14s
51+
pod/whereabouts-reconciler-xn5xz 1/1 Running 0 4m14s
52+
daemonset.apps/whereabouts-reconciler 6 6 6 6 6 kubernetes.io/os=linux 4m16s
53+
----
54+
55+
. Run the following command to verify that the `whereabouts-reconciler` pod runs the IP reconciler with the configured interval:
56+
+
57+
[source,terminal]
58+
----
59+
$ oc -n openshift-multus logs whereabouts-reconciler-2p7hw
60+
----
61+
+
62+
.Example output
63+
64+
[source,terminal]
65+
----
66+
2024-02-02T16:33:54Z [debug] event not relevant: "/cron-schedule/..2024_02_02_16_33_54.1375928161": CREATE
67+
2024-02-02T16:33:54Z [debug] event not relevant: "/cron-schedule/..2024_02_02_16_33_54.1375928161": CHMOD
68+
2024-02-02T16:33:54Z [debug] event not relevant: "/cron-schedule/..data_tmp": RENAME
69+
2024-02-02T16:33:54Z [verbose] using expression: */15 * * * *
70+
2024-02-02T16:33:54Z [verbose] configuration updated to file "/cron-schedule/..data". New cron expression: */15 * * * *
71+
2024-02-02T16:33:54Z [verbose] successfully updated CRON configuration id "00c2d1c9-631d-403f-bb86-73ad104a6817" - new cron expression: */15 * * * *
72+
2024-02-02T16:33:54Z [debug] event not relevant: "/cron-schedule/config": CREATE
73+
2024-02-02T16:33:54Z [debug] event not relevant: "/cron-schedule/..2024_02_02_16_26_17.3874177937": REMOVE
74+
2024-02-02T16:45:00Z [verbose] starting reconciler run
75+
2024-02-02T16:45:00Z [debug] NewReconcileLooper - inferred connection data
76+
2024-02-02T16:45:00Z [debug] listing IP pools
77+
2024-02-02T16:45:00Z [debug] no IP addresses to cleanup
78+
2024-02-02T16:45:00Z [verbose] reconciler success
79+
----
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/multiple_networks/configuring-additional-network.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
7+
[id="nw-multus-creating-whereabouts-reconciler-daemon-set_{context}"]
8+
= Creating a whereabouts-reconciler daemon set
9+
10+
The Whereabouts reconciler is responsible for managing dynamic IP address assignments for the pods within a cluster using the Whereabouts IP Address Management (IPAM) solution. It ensures that each pod gets a unique IP address from the specified IP address range. It also handles IP address releases when pods are deleted or scaled down.
11+
12+
[NOTE]
13+
====
14+
You can also use a `NetworkAttachmentDefinition` custom resource (CR) for dynamic IP address assignment.
15+
====
16+
17+
The `whereabouts-reconciler` daemon set is automatically created when you configure an additional network through the Cluster Network Operator. It is not automatically created when you configure an additional network from a YAML manifest.
18+
19+
To trigger the deployment of the `whereabouts-reconciler` daemon set, you must manually create a `whereabouts-shim` network attachment by editing the Cluster Network Operator custom resource (CR) file.
20+
21+
Use the following procedure to deploy the `whereabouts-reconciler` daemon set.
22+
23+
.Procedure
24+
25+
. Edit the `Network.operator.openshift.io` custom resource (CR) by running the following command:
26+
+
27+
[source,terminal]
28+
----
29+
$ oc edit network.operator.openshift.io cluster
30+
----
31+
32+
. Modify the `additionalNetworks` parameter in the CR to add the `whereabouts-shim` network attachment definition. For example:
33+
+
34+
[source,yaml]
35+
----
36+
apiVersion: operator.openshift.io/v1
37+
kind: Network
38+
metadata:
39+
name: cluster
40+
spec:
41+
additionalNetworks:
42+
- name: whereabouts-shim
43+
namespace: default
44+
rawCNIConfig: |-
45+
{
46+
"name": "whereabouts-shim",
47+
"cniVersion": "0.3.1",
48+
"type": "bridge",
49+
"ipam": {
50+
"type": "whereabouts"
51+
}
52+
}
53+
type: Raw
54+
----
55+
56+
. Save the file and exit the text editor.
57+
58+
. Verify that the `whereabouts-reconciler` daemon set deployed successfully by running the following command:
59+
+
60+
[source,terminal]
61+
----
62+
$ oc get all -n openshift-multus | grep whereabouts-reconciler
63+
----
64+
+
65+
.Example output
66+
+
67+
[source,terminal]
68+
----
69+
pod/whereabouts-reconciler-jnp6g 1/1 Running 0 6s
70+
pod/whereabouts-reconciler-k76gg 1/1 Running 0 6s
71+
pod/whereabouts-reconciler-k86t9 1/1 Running 0 6s
72+
pod/whereabouts-reconciler-p4sxw 1/1 Running 0 6s
73+
pod/whereabouts-reconciler-rvfdv 1/1 Running 0 6s
74+
pod/whereabouts-reconciler-svzw9 1/1 Running 0 6s
75+
daemonset.apps/whereabouts-reconciler 6 6 6 6 6 kubernetes.io/os=linux 6s
76+
----

modules/nw-multus-ipam-object.adoc

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -239,75 +239,4 @@ Whereabouts can be used for both IPv4 and IPv6 addresses.
239239

240240
ifdef::sr-iov[]
241241
:!sr-iov:
242-
endif::[]
243-
244-
[id="nw-multus-creating-whereabouts-reconciler-daemon-set_{context}"]
245-
== Creating a Whereabouts reconciler daemon set
246-
247-
The Whereabouts reconciler is responsible for managing dynamic IP address assignments for the pods within a cluster using the Whereabouts IP Address Management (IPAM) solution. It ensures that each pods gets a unique IP address from the specified IP address range. It also handles IP address releases when pods are deleted or scaled down.
248-
249-
[NOTE]
250-
====
251-
You can also use a `NetworkAttachmentDefinition` custom resource for dynamic IP address assignment.
252-
====
253-
254-
The Whereabouts reconciler daemon set is automatically created when you configure an additional network through the Cluster Network Operator. It is not automatically created when you configure an additional network from a YAML manifest.
255-
256-
To trigger the deployment of the Whereabouts reconciler daemonset, you must manually create a `whereabouts-shim` network attachment by editing the Cluster Network Operator custom resource file.
257-
258-
Use the following procedure to deploy the Whereabouts reconciler daemonset.
259-
260-
.Procedure
261-
262-
. Edit the `Network.operator.openshift.io` custom resource (CR) by running the following command:
263-
+
264-
[source,terminal]
265-
----
266-
$ oc edit network.operator.openshift.io cluster
267-
----
268-
269-
. Modify the `additionalNetworks` parameter in the CR to add the `whereabouts-shim` network attachment definition. For example:
270-
+
271-
[source,yaml]
272-
----
273-
apiVersion: operator.openshift.io/v1
274-
kind: Network
275-
metadata:
276-
name: cluster
277-
spec:
278-
additionalNetworks:
279-
- name: whereabouts-shim
280-
namespace: default
281-
rawCNIConfig: |-
282-
{
283-
"name": "whereabouts-shim",
284-
"cniVersion": "0.3.1",
285-
"type": "bridge",
286-
"ipam": {
287-
"type": "whereabouts"
288-
}
289-
}
290-
type: Raw
291-
----
292-
293-
. Save the file and exit the text editor.
294-
295-
. Verify that the `whereabouts-reconciler` daemon set deployed successfully by running the following command:
296-
+
297-
[source,terminal]
298-
----
299-
$ oc get all -n openshift-multus | grep whereabouts-reconciler
300-
----
301-
+
302-
.Example output
303-
+
304-
[source,terminal]
305-
----
306-
pod/whereabouts-reconciler-jnp6g 1/1 Running 0 6s
307-
pod/whereabouts-reconciler-k76gg 1/1 Running 0 6s
308-
pod/whereabouts-reconciler-k86t9 1/1 Running 0 6s
309-
pod/whereabouts-reconciler-p4sxw 1/1 Running 0 6s
310-
pod/whereabouts-reconciler-rvfdv 1/1 Running 0 6s
311-
pod/whereabouts-reconciler-svzw9 1/1 Running 0 6s
312-
daemonset.apps/whereabouts-reconciler 6 6 6 6 6 kubernetes.io/os=linux 6s
313-
----
242+
endif::[]

networking/multiple_networks/configuring-additional-network.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ include::modules/configuring-pods-static-ip.adoc[leveloffset=+3]
168168

169169
include::modules/nw-multus-ipam-object.adoc[leveloffset=+1]
170170

171+
include::modules/nw-multus-creating-whereabouts-reconciler-daemon-set.adoc[leveloffset=+2]
172+
173+
include::modules/nw-multus-configuring-whereabouts-ip-reconciler-schedule.adoc[leveloffset=+2]
174+
171175
include::modules/nw-multus-configure-dualstack-ip-address.adoc[leveloffset=+2]
172176

173177
[role="_additional-resources"]

0 commit comments

Comments
 (0)