Skip to content

Commit f460704

Browse files
authored
Merge pull request #64687 from JoeAldinger/OSDOCS-6269-nf
/lgtm, merging
2 parents c12f5e7 + f31a05b commit f460704

File tree

4 files changed

+69
-54
lines changed

4 files changed

+69
-54
lines changed

modules/nw-network-flows-create.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $ for pod in $(oc get pods -n openshift-ovn-kubernetes -l app=ovnkube-node -o js
6565
do ;
6666
echo;
6767
echo $pod;
68-
oc -n openshift-ovn-kubernetes exec -c ovnkube-node $pod \
68+
oc -n openshift-ovn-kubernetes exec -c ovnkube-controller $pod \
6969
-- bash -c 'for type in ipfix sflow netflow ; do ovs-vsctl find $type ; done';
7070
done
7171
----

modules/nw-ovn-kubernetes-install-ovnkube-trace-local.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ The `ovnkube-trace` tool traces packet simulations for arbitrary UDP or TCP traf
1919
+
2020
[source,terminal]
2121
----
22-
$ POD=$(oc get pods -n openshift-ovn-kubernetes -l app=ovnkube-master -o name | head -1 | awk -F '/' '{print $NF}')
22+
$ POD=$(oc get pods -n openshift-ovn-kubernetes -l app=ovnkube-control-plane -o name | head -1 | awk -F '/' '{print $NF}')
2323
----
2424

25-
. Run the following command on your local host to copy the binary from the `ovnkube-master` pods:
25+
. Run the following command on your local host to copy the binary from the `ovnkube-control-plane` pods:
2626
+
2727
[source,terminal]
2828
----
29-
$ oc cp -n openshift-ovn-kubernetes $POD:/usr/bin/ovnkube-trace ovnkube-trace
29+
$ oc cp -n openshift-ovn-kubernetes $POD:/usr/bin/ovnkube-trace -c ovnkube-cluster-manager ovnkube-trace
3030
----
3131

3232
. Make `ovnkube-trace` executable by running the following command:
@@ -47,8 +47,9 @@ $ ./ovnkube-trace -help
4747
+
4848
[source,terminal]
4949
----
50-
I0111 15:05:27.973305 204872 ovs.go:90] Maximum command line arguments set to: 191102
5150
Usage of ./ovnkube-trace:
51+
-addr-family string
52+
Address family (ip4 or ip6) to be used for tracing (default "ip4")
5253
-dst string
5354
dest: destination pod name
5455
-dst-ip string

modules/nw-ovn-kubernetes-running-ovnkube-trace.adoc

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This example illustrates how to test the DNS resolution from a deployed pod to t
2424
+
2525
[source,terminal]
2626
----
27-
$ oc run web --namespace=default --image=nginx --labels="app=web" --expose --port=80
27+
$ oc run web --namespace=default --image=quay.io/openshifttest/nginx --labels="app=web" --expose --port=80
2828
----
2929

3030
. List the pods running in the `openshift-dns` namespace:
@@ -39,29 +39,29 @@ oc get pods -n openshift-dns
3939
[source,terminal]
4040
----
4141
NAME READY STATUS RESTARTS AGE
42-
dns-default-467qw 2/2 Running 0 49m
43-
dns-default-6prvx 2/2 Running 0 53m
44-
dns-default-fkqr8 2/2 Running 0 53m
45-
dns-default-qv2rg 2/2 Running 0 49m
46-
dns-default-s29vr 2/2 Running 0 49m
47-
dns-default-vdsbn 2/2 Running 0 53m
48-
node-resolver-6thtt 1/1 Running 0 53m
49-
node-resolver-7ksdn 1/1 Running 0 49m
50-
node-resolver-8sthh 1/1 Running 0 53m
51-
node-resolver-c5ksw 1/1 Running 0 50m
52-
node-resolver-gbvdp 1/1 Running 0 53m
53-
node-resolver-sxhkd 1/1 Running 0 50m
54-
----
55-
56-
. Run the following `ovn-kube-trace` command to verify DNS resolution is working:
42+
dns-default-8s42x 2/2 Running 0 5h8m
43+
dns-default-mdw6r 2/2 Running 0 4h58m
44+
dns-default-p8t5h 2/2 Running 0 4h58m
45+
dns-default-rl6nk 2/2 Running 0 5h8m
46+
dns-default-xbgqx 2/2 Running 0 5h8m
47+
dns-default-zv8f6 2/2 Running 0 4h58m
48+
node-resolver-62jjb 1/1 Running 0 5h8m
49+
node-resolver-8z4cj 1/1 Running 0 4h59m
50+
node-resolver-bq244 1/1 Running 0 5h8m
51+
node-resolver-hc58n 1/1 Running 0 4h59m
52+
node-resolver-lm6z4 1/1 Running 0 5h8m
53+
node-resolver-zfx5k 1/1 Running 0 5h
54+
----
55+
56+
. Run the following `ovnkube-trace` command to verify DNS resolution is working:
5757
+
5858
[source,terminal]
5959
----
6060
$ ./ovnkube-trace \
6161
-src-namespace default \ <1>
6262
-src web \ <2>
6363
-dst-namespace openshift-dns \ <3>
64-
-dst dns-default-467qw \ <4>
64+
-dst dns-default-p8t5h \ <4>
6565
-udp -dst-port 53 \ <5>
6666
-loglevel 0 <6>
6767
----
@@ -71,24 +71,37 @@ $ ./ovnkube-trace \
7171
<3> Namespace of destination pod
7272
<4> Destination pod name
7373
<5> Use the `udp` transport protocol. Port 53 is the port the DNS service uses.
74-
<6> Set the log level to 1 (0 is minimal and 5 is debug)
74+
<6> Set the log level to 0 (0 is minimal and 5 is debug)
7575
+
76-
.Expected output
76+
.Example output if the `src&dst` pod lands on the same node:
7777
[source,terminal]
7878
----
79-
I0116 10:19:35.601303 17900 ovs.go:90] Maximum command line arguments set to: 191102
80-
ovn-trace source pod to destination pod indicates success from web to dns-default-467qw
81-
ovn-trace destination pod to source pod indicates success from dns-default-467qw to web
82-
ovs-appctl ofproto/trace source pod to destination pod indicates success from web to dns-default-467qw
83-
ovs-appctl ofproto/trace destination pod to source pod indicates success from dns-default-467qw to web
84-
ovn-detrace source pod to destination pod indicates success from web to dns-default-467qw
85-
ovn-detrace destination pod to source pod indicates success from dns-default-467qw to web
79+
ovn-trace source pod to destination pod indicates success from web to dns-default-p8t5h
80+
ovn-trace destination pod to source pod indicates success from dns-default-p8t5h to web
81+
ovs-appctl ofproto/trace source pod to destination pod indicates success from web to dns-default-p8t5h
82+
ovs-appctl ofproto/trace destination pod to source pod indicates success from dns-default-p8t5h to web
83+
ovn-detrace source pod to destination pod indicates success from web to dns-default-p8t5h
84+
ovn-detrace destination pod to source pod indicates success from dns-default-p8t5h to web
85+
----
86+
+
87+
.Example output if the `src&dst` pod lands on a different node:
88+
[source,terminal]
89+
----
90+
ovn-trace source pod to destination pod indicates success from web to dns-default-8s42x
91+
ovn-trace (remote) source pod to destination pod indicates success from web to dns-default-8s42x
92+
ovn-trace destination pod to source pod indicates success from dns-default-8s42x to web
93+
ovn-trace (remote) destination pod to source pod indicates success from dns-default-8s42x to web
94+
ovs-appctl ofproto/trace source pod to destination pod indicates success from web to dns-default-8s42x
95+
ovs-appctl ofproto/trace destination pod to source pod indicates success from dns-default-8s42x to web
96+
ovn-detrace source pod to destination pod indicates success from web to dns-default-8s42x
97+
ovn-detrace destination pod to source pod indicates success from dns-default-8s42x to web
98+
8699
----
87100
+
88101
The ouput indicates success from the deployed pod to the DNS port and also indicates that it is
89102
successful going back in the other direction. So you know bi-directional traffic is supported on UDP port 53 if my web pod wants to do dns resolution from core DNS.
90103

91-
If for example that did not work and you wanted to get the `ovn-trace`, the `ovs-appctl ofproto/trace` and `ovn-detrace`, and more debug type information increase the log level to 2 and run the command again as follows:
104+
If for example that did not work and you wanted to get the `ovn-trace`, the `ovs-appctl` of `proto/trace` and `ovn-detrace`, and more debug type information increase the log level to 2 and run the command again as follows:
92105

93106
[source,terminal]
94107
----
@@ -140,7 +153,7 @@ networkpolicy.networking.k8s.io/deny-by-default created
140153
+
141154
[source,terminal]
142155
----
143-
$ oc run web --namespace=default --image=nginx --labels="app=web" --expose --port=80
156+
$ oc run web --namespace=default --image=quay.io/openshifttest/nginx --labels="app=web" --expose --port=80
144157
----
145158

146159
. Run the following command to create the `prod` namespace:
@@ -179,14 +192,11 @@ $ ./ovnkube-trace \
179192
-loglevel 0
180193
----
181194
+
182-
.Expected output
183-
195+
.Example output
184196
[source,terminal]
185197
----
186-
I0116 14:20:47.380775 50822 ovs.go:90] Maximum command line arguments set to: 191102
187198
ovn-trace source pod to destination pod indicates failure from test-6459 to web
188199
----
189-
190200
. Increase the log level to 2 to expose the reason for the failure by running the following command:
191201
+
192202
[source,terminal]
@@ -200,21 +210,29 @@ $ ./ovnkube-trace \
200210
-loglevel 2
201211
----
202212
+
203-
.Expected output
204-
213+
.Example output
205214
[source,terminal]
206215
----
207-
ct_lb_mark /* default (use --ct to customize) */
216+
...
208217
------------------------------------------------
209-
3. ls_out_acl_hint (northd.c:6092): !ct.new && ct.est && !ct.rpl && ct_mark.blocked == 0, priority 4, uuid 32d45ad4
218+
3. ls_out_acl_hint (northd.c:7454): !ct.new && ct.est && !ct.rpl && ct_mark.blocked == 0, priority 4, uuid 12efc456
210219
reg0[8] = 1;
211220
reg0[10] = 1;
212221
next;
213-
4. ls_out_acl (northd.c:6435): reg0[10] == 1 && (outport == @a16982411286042166782_ingressDefaultDeny), priority 2000, uuid f730a887 <1>
214-
ct_commit { ct_mark.blocked = 1; };
222+
5. ls_out_acl_action (northd.c:7835): reg8[30..31] == 0, priority 500, uuid 69372c5d
223+
reg8[30..31] = 1;
224+
next(4);
225+
5. ls_out_acl_action (northd.c:7835): reg8[30..31] == 1, priority 500, uuid 2fa0af89
226+
reg8[30..31] = 2;
227+
next(4);
228+
4. ls_out_acl_eval (northd.c:7691): reg8[30..31] == 2 && reg0[10] == 1 && (outport == @a16982411286042166782_ingressDefaultDeny), priority 2000, uuid 447d0dab
229+
reg8[17] = 1;
230+
ct_commit { ct_mark.blocked = 1; }; <1>
231+
next;
232+
...
215233
----
216234
+
217-
<1> Ingress traffic is blocked due to the default deny policy being in place
235+
<1> Ingress traffic is blocked due to the default deny policy being in place.
218236
219237
. Create a policy that allows traffic from all pods in a particular namespaces with a label `purpose=production`. Save the YAML in the `web-allow-prod.yaml` file:
220238
+
@@ -261,7 +279,6 @@ $ ./ovnkube-trace \
261279
.Expected output
262280
[source,terminal]
263281
----
264-
I0116 14:25:44.055207 51695 ovs.go:90] Maximum command line arguments set to: 191102
265282
ovn-trace source pod to destination pod indicates success from test-6459 to web
266283
ovn-trace destination pod to source pod indicates success from web to test-6459
267284
ovs-appctl ofproto/trace source pod to destination pod indicates success from test-6459 to web
@@ -270,7 +287,7 @@ ovn-detrace source pod to destination pod indicates success from test-6459 to we
270287
ovn-detrace destination pod to source pod indicates success from web to test-6459
271288
----
272289

273-
. In the open shell run the following command:
290+
. Run the following command in the shell that was opened in step six to connect nginx to the web-server:
274291
+
275292
[source,terminal]
276293
----
@@ -286,9 +303,11 @@ ovn-detrace destination pod to source pod indicates success from web to test-645
286303
<head>
287304
<title>Welcome to nginx!</title>
288305
<style>
289-
html { color-scheme: light dark; }
290-
body { width: 35em; margin: 0 auto;
291-
font-family: Tahoma, Verdana, Arial, sans-serif; }
306+
body {
307+
width: 35em;
308+
margin: 0 auto;
309+
font-family: Tahoma, Verdana, Arial, sans-serif;
310+
}
292311
</style>
293312
</head>
294313
<body>

networking/ovn_kubernetes_network_provider/ovn-kubernetes-tracing-using-ovntrace.adoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ OVN and OVS traffic flows can be simulated in a single utility called `ovnkube-t
1010

1111
You can execute the `ovnkube-trace` binary from a dedicated container. For releases after {product-title} 4.7, you can also copy the binary to a local host and execute it from that host.
1212

13-
[NOTE]
14-
====
15-
The binaries in the Quay images do not currently work for Dual IP stack or IPv6 only environments. For those environments, you must build from source.
16-
====
17-
1813
include::modules/nw-ovn-kubernetes-install-ovnkube-trace-local.adoc[leveloffset=+1]
1914

2015
include::modules/nw-ovn-kubernetes-running-ovnkube-trace.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)