Questo contenuto non è disponibile nella lingua selezionata.
Chapter 15. Secondary networks
You can configure the Network Observability Operator to collect and enrich network flow data from secondary networks, such as
SR-IOV
OVN-Kubernetes
15.1. Prerequisites Copia collegamentoCollegamento copiato negli appunti!
- Access to an OpenShift Container Platform cluster with an additional network interface, such as a secondary interface or an L2 network.
15.2. Configuring monitoring for SR-IOV interface traffic Copia collegamentoCollegamento copiato negli appunti!
In order to collect traffic from a cluster with a Single Root I/O Virtualization (SR-IOV) device, you must set the
FlowCollector
spec.agent.ebpf.privileged
true
SRIOVNetwork
IPAM
Prerequisites
- Access to an OpenShift Container Platform cluster with a SR-IOV device.
-
The custom resource (CR)
SRIOVNetworkconfiguration must be set with an IP address from the range that the interface lists or from other plugins.spec.ipam
Procedure
-
In the web console, navigate to Operators
Installed Operators. - Under the Provided APIs heading for the NetObserv Operator, select Flow Collector.
- Select cluster and then select the YAML tab.
Configure the
custom resource. A sample configuration is as follows:FlowCollectorConfigure
FlowCollectorfor SR-IOV monitoringapiVersion: flows.netobserv.io/v1beta2 kind: FlowCollector metadata: name: cluster spec: namespace: netobserv deploymentModel: Service agent: type: eBPF ebpf: privileged: true1 - 1
- The
spec.agent.ebpf.privilegedfield value must be set totrueto enable SR-IOV monitoring.
15.3. Configuring virtual machine (VM) secondary network interfaces for Network Observability Copia collegamentoCollegamento copiato negli appunti!
You can observe network traffic on an OpenShift Virtualization setup by identifying eBPF-enriched network flows coming from VMs that are connected to secondary networks, such as through OVN-Kubernetes. Network flows coming from VMs that are connected to the default internal pod network are automatically captured by Network Observability.
Procedure
Get information about the virtual machine launcher pod by running the following command. This information is used in Step 5:
$ oc get pod virt-launcher-<vm_name>-<suffix> -n <namespace> -o yamlapiVersion: v1 kind: Pod metadata: annotations: k8s.v1.cni.cncf.io/network-status: |- [{ "name": "ovn-kubernetes", "interface": "eth0", "ips": [ "10.129.2.39" ], "mac": "0a:58:0a:81:02:27", "default": true, "dns": {} }, { "name": "my-vms/l2-network",1 "interface": "podc0f69e19ba2",2 "ips": [3 "10.10.10.15" ], "mac": "02:fb:f8:00:00:12",4 "dns": {} }] name: virt-launcher-fedora-aqua-fowl-13-zr2x9 namespace: my-vms spec: # ... status: # ...-
In the web console, navigate to Operators
Installed Operators. - Under the Provided APIs heading for the NetObserv Operator, select Flow Collector.
- Select cluster and then select the YAML tab.
Configure
based on the information you found from the additional network investigation:FlowCollectorapiVersion: flows.netobserv.io/v1beta2 kind: FlowCollector metadata: name: cluster spec: agent: ebpf: privileged: true1 processor: advanced: secondaryNetworks: - index: \2 - MAC \3 name: my-vms/l2-network \4 # ...- 1
- Ensure that the eBPF agent is in
privilegedmode so that flows are collected for secondary interfaces. - 2
- Define the fields to use for indexing the virtual machine launcher pods. It is recommended to use the
MACaddress as the indexing field to get network flows enrichment for secondary interfaces. If you have overlapping MAC address between pods, then additional indexing fields, such asIPandInterface, could be added to have accurate enrichment. - 3
- If your additional network information has a MAC address, add
MACto the field list. - 4
- Specify the name of the network found in the
k8s.v1.cni.cncf.io/network-statusannotation. Usually <namespace>/<network_attachement_definition_name>.
Observe VM traffic:
- Navigate to the Network Traffic page.
-
Filter by Source IP using your virtual machine IP found in annotation.
k8s.v1.cni.cncf.io/network-status - View both Source and Destination fields, which should be enriched, and identify the VM launcher pods and the VM instance as owners.