You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/posts/2025-01-23-cli_whats_new_1.8.md
+103-4Lines changed: 103 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,11 +28,39 @@ This update adds several options to the CLI, covering more scenarios and enablin
28
28
### Operate in the Background
29
29
The `--background` option allows you to start a flow or packet capture without connecting your terminal to the collector pod. This enables you to let the capture run in the background while you work on something else. You can check the capture's progress using the `follow` command and copy the collector output locally using the `copy` command. Once the job is complete, you can `stop` or `cleanup` everything.
30
30
31
+
```sh
32
+
oc netobserv flows --background # Run a flow capture in the background
33
+
34
+
oc netobserv follow # Show current capture progression
35
+
36
+
oc netobserv stop # Stop the capture keeping the collector running
37
+
38
+
oc netobserv copy # Copy the output
39
+
40
+
oc netobserv cleanup # Remove all
41
+
```
42
+
31
43
### Customizable Namespace
32
44
You can now customize the capture namespace using the `NETOBSERV_NAMESPACE` environment variable. When the CLI starts, it automatically checks if this namespace exists and will stop if it finds any conflict with a pending capture. This is particularly useful if you want to run captures in parallel.
The tool can now read configurations from `cluster-config-v1` and `network` to identify **Machine**, **Pods**, and **Services** subnets using the `--get-subnet` option. This will automatically add `SrcSubnetLabel` and `DstSubnetLabel` to your flows.
51
+
The tool can now 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.
52
+
53
+
You will see subnets being configured during the creation of the agents:
Outputting a `.yml` file instead of running the capture is now possible using the `--yaml` option. The file will contain all the resources needed to run the capture, such as the namespace, the agents embedding the pipeline and its configuration, and the related services. The collector will need to be run manually in parallel to start the capture.
@@ -43,29 +71,56 @@ Filtering is crucial to gather precise network data without involving excessive
43
71
### Assigning Agents to Nodes
44
72
It's now possible to define agents `nodeSelector` to capture on a subset of nodes. You can rely on existing labels or create a dedicated one for this usage. For example, you can run:
to run the agents on the node with the `kubernetes.io/hostname:my-node` label.
49
77
50
78
### eBPF Filters
51
79
Agents recently introduced [the ability to filter](https://github.com/netobserv/netobserv-ebpf-agent/blob/main/docs/flow_filtering.md) on IPs, Ports, Protocol, Action, TCPFlags, and more simultaneously. You can now apply these filters in the CLI as shown below:
52
80
53
81
```sh
54
-
netobserv flows \# Capture flows
82
+
oc netobserv flows \ # Capture flows
55
83
--protocol=TCP --port=8080 \ # either on TCP 8080
56
84
or --protocol=UDP # or UDP
57
85
```
58
86
87
+
You will see filters being validated during the creation of the agents:
You can add as many filters as you want and separate them by or to create multiple capture scenarios.
60
99
61
100
### Regular Expressions Usage
62
101
If you need to filter on enriched content beyond the agent-level filters, you can use **regexes** to match any field/value pair. To filter all traffic from OpenShift namespaces, for example, you can use `--regexes=SrcK8S_Namespace~openshift.*`.
63
102
103
+
You will see regexes being validated during the creation of the agents:
Regexes are comma-separated, so you can use multiple at once, such as `--regexes=SrcK8S_Namespace~my-ns,SrcK8S_Name~my-app`. Refer to the [flows format](https://github.com/netobserv/network-observability-operator/blob/main/docs/flows-format.adoc) to see the possible fields.
65
113
66
114
## Unified Collector UI
67
115
Capturing **packets** now resembles **flows** capture, allowing you to live filter the content. This improvement was made possible by introducing the [flowlogs-pipeline](https://github.com/netobserv/flowlogs-pipeline) component inside [eBPF agents](https://github.com/netobserv/netobserv-ebpf-agent), which parse packets and generate flows from them. All filtering capabilities are compatible with this approach!
68
116
117
+
Run a packet capture on a specitic port for example:
Capturing metrics is now possible using the `metrics` command. This creates a `ServiceMonitor` to gather metrics from the agents and store them in [Prometheus](https://prometheus.io/). You can enable all or specific features to gather more information about your network, such in:
71
126
```sh
@@ -83,7 +138,7 @@ On top of the features, you can use all the filtering capabilities mentioned abo
83
138
84
139
## Help!
85
140
86
-
The help has been enhanced to provide examples for each command and option. You can type `oc netobserv help` for the general help message or request help on a specific command, such as `oc netobserv metrics help`, to get its options list.
141
+
The help has been enhanced to provide examples for each command and option. You can type `oc netobserv help` for the general help message:
87
142
88
143
```sh
89
144
$ oc netobserv help
@@ -128,6 +183,50 @@ advanced examples:
128
183
--max-bytes=100000000 # for a maximum of 100MB
129
184
```
130
185
186
+
You can also request help on a specific command, such as `oc netobserv metrics help`, to get its options list:
187
+
```sh
188
+
$ oc netobserv metrics help
189
+
190
+
Netobserv allows you to capture metrics on your OCP cluster.
191
+
Find more information at: https://github.com/netobserv/network-observability-cli/
192
+
193
+
Syntax: netobserv metrics [options]
194
+
195
+
features:
196
+
--enable_all: enable all eBPF features (default: false)
197
+
--enable_dns: enable DNS tracking (default: false)
0 commit comments