Skip to content

Commit f958c46

Browse files
committed
subnets scenario
1 parent 7a0f5f8 commit f958c46

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

content/posts/2025-01-28-cli_use_cases.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,37 @@ LAST SEEN TYPE REASON OBJECT MESSAGE
4040
0s Normal Started Pod/collector Started container collector
4141
```
4242

43+
## North / South and East / West traffic
44+
The CLI is able to read configurations from `cluster-config-v1` and `network` to identify **Machine**, **Pods**, and **Services** subnets using the `--get-subnets` option. This will automatically add `SrcSubnetLabel` and `DstSubnetLabel` to your flows.
45+
46+
You will see subnets being configured during the creation of the agents:
47+
```sh
48+
creating flow-capture agents:
49+
opt: get_subnets, value: true
50+
Found subnets:
51+
Services: "172.30.0.0/16"
52+
Pods: "10.128.0.0/14"
53+
Machines: "10.0.0.0/16"
54+
```
55+
56+
Once running, you can cycle to different views using left / right arrow keys and change the displayed enrichment colomns using page up / down ones.
57+
Also, to adapt to your screen height, you can increase / decrease the number of displayed flows using up / down arrow keys.
58+
59+
![subnets]({page.image('cli/subnets.png')})
60+
61+
You can live filter this capture by typing Machines / Pods or Services keyword to only see what you look for here.
62+
63+
However, if you want to capture only a subset of these flows, you can use the regexes filter on top such as:
64+
```sh
65+
oc netobserv flows --get-subnets --regexes=SrcSubnetLabel~Pods,DstSubnetLabel~Services
66+
```
67+
68+
**WARNING: Running regexes filters means that all the flows are captured and enriched before applying this filter stage in the pipeline. To avoid performance impact on your cluster, use eBPF filters such as IPs, Ports and Protocol as most as possible.**
69+
70+
The output will now only show **Pods** to **Services** flows:
71+
![pods subnets]({page.image('cli/pods-subnets.png')})
72+
73+
4374
## Connectivity check(s) between two endpoints
4475

4576
Let's start with a simple case where you have a pod not able to reach an endpoint. We are using a simple nodejs sample app deployed in `connectivity-scenario` namespace for the demo.
@@ -135,10 +166,7 @@ At this stage, the collector wait for incoming data. If nothing shows yet, it me
135166
Once some traffic is captured, the output will look like:
136167
![cli network events]({page.image('cli/connectivity-scenario-cli-events.png')})
137168
138-
You can cycle to different views using left / right arrow keys and change the displayed enrichment colomns using page up / down ones.
139-
Also, to adapt to your screen height, you can increase / decrease the number of displayed flows using up / down arrow keys.
140-
141-
In this capture, we see that the traffic is blocked by a network policy since it reports the `NetpolNamespace` network event.
169+
Cycle to the **network events** view. In this capture, we see that the traffic is blocked by a network policy since it reports the `NetpolNamespace` event.
142170
Edit your network policies and give another try.
143171
144172
Behind the scenes in our scenario, we used to have a deny all on the pod label:
239 KB
Loading
231 KB
Loading

0 commit comments

Comments
 (0)