Skip to content

Commit fa15522

Browse files
authored
Merge pull request #75944 from jab-rh/OSDOCS-8766
OSDOCS-8766: Add configurable connectivity check
2 parents e18632f + 338b090 commit fa15522

4 files changed

+95
-1
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/verifying-connectivity-endpoint.adoc
4+
5+
[id="nw-pod-network-connectivity-configuration_{context}"]
6+
= Configuring pod connectivity check placement
7+
8+
As a cluster administrator, you can configure which nodes the connectivity check pods run by modifying the `network.config.openshift.io` object named `cluster`.
9+
10+
.Prerequisites
11+
12+
* Install the {oc-first}.
13+
14+
.Procedure
15+
16+
. To edit the connectivity check configuration, enter the following command:
17+
+
18+
[source,terminal]
19+
----
20+
$ oc edit network.config.openshift.io cluster
21+
----
22+
23+
. In the text editor, update the `networkDiagnostics` stanza to specify the node selectors that you want for the source and target pods.
24+
25+
. To commit your changes, save your changes and exit the text editor.
26+
27+
.Verification
28+
29+
To verify that the source and target pods are running on the intended nodes, enter the following command:
30+
31+
[source,terminal]
32+
----
33+
$ oc get pods -n openshift-network-diagnostics -o wide
34+
----
35+
36+
.Example output
37+
[source,text]
38+
----
39+
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
40+
network-check-source-84c69dbd6b-p8f7n 1/1 Running 0 9h 10.131.0.8 ip-10-0-40-197.us-east-2.compute.internal <none> <none>
41+
network-check-target-46pct 1/1 Running 0 9h 10.131.0.6 ip-10-0-40-197.us-east-2.compute.internal <none> <none>
42+
network-check-target-8kwgf 1/1 Running 0 9h 10.128.2.4 ip-10-0-95-74.us-east-2.compute.internal <none> <none>
43+
network-check-target-jc6n7 1/1 Running 0 9h 10.129.2.4 ip-10-0-21-151.us-east-2.compute.internal <none> <none>
44+
network-check-target-lvwnn 1/1 Running 0 9h 10.128.0.7 ip-10-0-17-129.us-east-2.compute.internal <none> <none>
45+
network-check-target-nslvj 1/1 Running 0 9h 10.130.0.7 ip-10-0-89-148.us-east-2.compute.internal <none> <none>
46+
network-check-target-z2sfx 1/1 Running 0 9h 10.129.0.4 ip-10-0-60-253.us-east-2.compute.internal <none> <none>
47+
----

modules/nw-pod-network-connectivity-implementation.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,28 @@ The Cluster Network Operator (CNO) deploys several resources to the cluster to s
1212
Health check source:: This program deploys in a single pod replica set managed by a `Deployment` object. The program consumes `PodNetworkConnectivity` objects and connects to the `spec.targetEndpoint` specified in each object.
1313

1414
Health check target:: A pod deployed as part of a daemon set on every node in the cluster. The pod listens for inbound health checks. The presence of this pod on every node allows for the testing of connectivity to each node.
15+
16+
You can configure the nodes which network connectivity sources and targets run on with a node selector. Additionally, you can specify permissible _tolerations_ for source and target pods. The configuration is defined in the singleton `cluster` custom resource of the `Network` API in the `config.openshift.io/v1` API group.
17+
18+
Pod scheduling occurs after you have updated the configuration. Therefore, you must apply node labels that you intend to use in your selectors before updating the configuration. Labels applied after updating your network connectivity check pod placement are ignored.
19+
20+
Refer to the default configuration in the following YAML:
21+
22+
.Default configuration for connectivity source and target pods
23+
[source,yaml]
24+
----
25+
apiVersion: config.openshift.io/v1
26+
kind: Network
27+
metadata:
28+
name: cluster
29+
spec:
30+
# ...
31+
networkDiagnostics: <1>
32+
mode: "" <2>
33+
sourcePlacement: {} <3>
34+
targetPlacement: {} <4>
35+
----
36+
<1> Specifies the network diagnostics configuration. If a value is not specified or an empty object is specified, and `spec.disableNetworkDiagnostics=true` is set in the `network.operator.openshift.io` custom resource named `cluster`, network diagnostics are disabled. If set, this value overrides `spec.disableNetworkDiagnostics=true`.
37+
<2> Specifies the diagnostics mode. The value can be the empty string, `All`, or `Disabled`. The empty string is equivalent to specifying `All`.
38+
<3> Optional: Specifies a selector for connectivity check source pods.
39+
<4> Optional: Specifies a selector for connectivity check target pods.

modules/nw-pod-network-connectivity-verify.adoc

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="nw-pod-network-connectivity-verify_{context}"]
77
= Verifying network connectivity for an endpoint
88

9-
As a cluster administrator, you can verify the connectivity of an endpoint, such as an API server, load balancer, service, or pod.
9+
As a cluster administrator, you can verify the connectivity of an endpoint, such as an API server, load balancer, service, or pod, and verify that network diagnostics is enabled.
1010

1111
.Prerequisites
1212

@@ -15,6 +15,27 @@ As a cluster administrator, you can verify the connectivity of an endpoint, such
1515
1616
.Procedure
1717

18+
. To confirm that network diagnostics are enabled, enter the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc get network.config.openshift.io cluster -o yaml
23+
----
24+
+
25+
.Example output
26+
[source,text]
27+
----
28+
# ...
29+
status:
30+
# ...
31+
conditions:
32+
- lastTransitionTime: "2024-05-27T08:28:39Z"
33+
message: ""
34+
reason: AsExpected
35+
status: "True"
36+
type: NetworkDiagnosticsAvailable
37+
----
38+
1839
. To list the current `PodNetworkConnectivityCheck` objects, enter the following command:
1940
+
2041
[source,terminal]

networking/verifying-connectivity-endpoint.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ By reviewing the results of the health checks, you can diagnose connection probl
1111

1212
include::modules/nw-pod-network-connectivity-checks.adoc[leveloffset=+1]
1313
include::modules/nw-pod-network-connectivity-implementation.adoc[leveloffset=+1]
14+
include::modules/nw-pod-network-connectivity-configuration.adoc[leveloffset=+1]
1415
include::modules/nw-pod-network-connectivity-check-object.adoc[leveloffset=+1]
1516
include::modules/nw-pod-network-connectivity-verify.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)