Skip to content

Commit ef53480

Browse files
authored
Merge pull request #83962 from skrthomas/cp-no-1.7-integration-4.12
Network Observability 1.7 4.12 manual CP
2 parents 8b6459f + dece694 commit ef53480

21 files changed

+923
-244
lines changed

_topic_maps/_topic_map.yml

+2
Original file line numberDiff line numberDiff line change
@@ -2680,6 +2680,8 @@ Topics:
26802680
File: network-observability-operator-monitoring
26812681
- Name: Scheduling resources
26822682
File: network-observability-scheduling-resources
2683+
- Name: Secondary networks
2684+
File: network-observability-secondary-networks
26832685
- Name: Network Observability CLI
26842686
Dir: netobserv_cli
26852687
Topics:

modules/network-observability-SRIOV-configuration.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * network_observability/configuring-operator.adoc
3+
// * observability/network_observability/network-observability-secondary-networks.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="network-observability-SR-IOV-config_{context}"]
@@ -16,7 +16,7 @@ In order to collect traffic from a cluster with a Single Root I/O Virtualization
1616
. Under the *Provided APIs* heading for the *NetObserv Operator*, select *Flow Collector*.
1717
. Select *cluster* and then select the *YAML* tab.
1818
. Configure the `FlowCollector` custom resource. A sample configuration is as follows:
19-
19+
+
2020
.Configure `FlowCollector` for SR-IOV monitoring
2121
[source,yaml]
2222
----

modules/network-observability-cli-capturing-flows.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ $ oc netobserv flows --enable_filter=true --action=Accept --cidr=0.0.0.0/0 --pro
2525
----
2626
live table filter: [SrcK8S_Zone:us-west-1b] press enter to match multiple regular expressions at once
2727
----
28+
. Use the *PageUp* and *PageDown* keys to toggle between *None*, *Resource*, *Zone*, *Host*, *Owner* and *all of the above*.
2829
. To stop capturing, press kbd:[Ctrl+C]. The data that was captured is written to two separate files in an `./output` directory located in the same path used to install the CLI.
2930
. View the captured data in the `./output/flow/<capture_date_time>.json` JSON file, which contains JSON arrays of the captured data.
3031
+

modules/network-observability-cli-capturing-packets.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ You can capture packets using the Network Observability CLI.
1616
+
1717
[source,terminal]
1818
----
19-
$ oc netobserv packets tcp,80
19+
$ oc netobserv packets --action=Accept --cidr=0.0.0.0/0 --protocol=TCP --port=49051
2020
----
2121
. Add filters to the `live table filter` prompt in the terminal to refine the incoming packets. An example filter is as follows:
2222
+
2323
[source,terminal]
2424
----
2525
live table filter: [SrcK8S_Zone:us-west-1b] press enter to match multiple regular expressions at once
2626
----
27+
. Use the *PageUp* and *PageDown* keys to toggle between *None*, *Resource*, *Zone*, *Host*, *Owner* and *all of the above*.
2728
. To stop capturing, press kbd:[Ctrl+C].
2829
. View the captured data, which is written to a single file in an `./output/pcap` directory located in the same path that was used to install the CLI:
2930
.. The `./output/pcap/<capture_date_time>.pcap` file can be opened with Wireshark.

modules/network-observability-create-network-policy.adoc

+48-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,54 @@
66
:_mod-docs-content-type: PROCEDURE
77
[id="network-observability-network-policy_{context}"]
88
= Creating a network policy for Network Observability
9-
You might need to create a network policy to secure ingress traffic to the `netobserv` namespace. In the web console, you can create a network policy using the form view.
9+
If you want to further customize the network policies for the `netobserv` and `netobserv-privileged` namespaces, you must disable the managed installation of the policy from the `FlowCollector` CR, and create your own. You can use the network policy resources that are enabled from the `FlowCollector` CR as a starting point for the procedure that follows:
10+
11+
.Example `netobserv` network policy
12+
[source,yaml]
13+
----
14+
apiVersion: networking.k8s.io/v1
15+
kind: NetworkPolicy
16+
spec:
17+
ingress:
18+
- from:
19+
- podSelector: {}
20+
- namespaceSelector:
21+
matchLabels:
22+
kubernetes.io/metadata.name: netobserv-privileged
23+
- from:
24+
- namespaceSelector:
25+
matchLabels:
26+
kubernetes.io/metadata.name: openshift-console
27+
ports:
28+
- port: 9001
29+
protocol: TCP
30+
- from:
31+
- namespaceSelector:
32+
matchLabels:
33+
kubernetes.io/metadata.name: openshift-monitoring
34+
podSelector: {}
35+
policyTypes:
36+
- Ingress
37+
----
38+
39+
.Example `netobserv-privileged` network policy
40+
[source,yaml]
41+
----
42+
apiVersion: networking.k8s.io/v1
43+
kind: NetworkPolicy
44+
metadata:
45+
name: netobserv
46+
namespace: netobserv-privileged
47+
spec:
48+
ingress:
49+
- from:
50+
- namespaceSelector:
51+
matchLabels:
52+
kubernetes.io/metadata.name: openshift-monitoring
53+
podSelector: {}
54+
policyTypes:
55+
- Ingress
56+
----
1057

1158
.Procedure
1259
. Navigate to *Networking* -> *NetworkPolicies*.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Module included in the following assemblies:
2+
3+
// * networking/network_observability/network-observability-network-policy.adoc
4+
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="network-observability-deploy-network-policy_{context}"]
8+
= Configuring an ingress network policy by using the FlowCollector custom resource
9+
You can configure the `FlowCollector` custom resource (CR) to deploy an ingress network policy for Network Observability by setting the `spec.NetworkPolicy.enable` specification to `true`. By default, the specification is `false`.
10+
11+
If you have installed Loki, Kafka or any exporter in a different namespace that also has a network policy, you must ensure that the Network Observability components can communicate with them. Consider the following about your setup:
12+
13+
* Connection to Loki (as defined in the `FlowCollector` CR `spec.loki` parameter)
14+
* Connection to Kafka (as defined in the `FlowCollector` CR `spec.kafka` parameter)
15+
* Connection to any exporter (as defined in FlowCollector CR `spec.exporters` parameter)
16+
* If you are using Loki and including it in the policy target, connection to an external object storage (as defined in your `LokiStack` related secret)
17+
18+
.Procedure
19+
. . In the web console, go to *Operators* -> *Installed Operators* page.
20+
. Under the *Provided APIs* heading for *Network Observability*, select *Flow Collector*.
21+
. Select *cluster* then select the *YAML* tab.
22+
. Configure the `FlowCollector` CR. A sample configuration is as follows:
23+
+
24+
[id="network-observability-flowcollector-configuring-network-policy_{context}"]
25+
.Example `FlowCollector` CR for network policy
26+
[source, yaml]
27+
----
28+
apiVersion: flows.netobserv.io/v1beta2
29+
kind: FlowCollector
30+
metadata:
31+
name: cluster
32+
spec:
33+
namespace: netobserv
34+
networkPolicy:
35+
enable: true <1>
36+
additionalNamespaces: ["openshift-console", "openshift-monitoring"] <2>
37+
# ...
38+
----
39+
<1> By default, the `enable` value is `false`.
40+
<2> Default values are `["openshift-console", "openshift-monitoring"]`.

modules/network-observability-enriched-flows.adoc

+32-12
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
[id="network-observability-enriched-flows_{context}"]
77
= Export enriched network flow data
88

9-
You can send network flows to Kafka, IPFIX, or both at the same time. Any processor or storage that supports Kafka or IPFIX input, such as Splunk, Elasticsearch, or Fluentd, can consume the enriched network flow data.
9+
You can send network flows to Kafka, IPFIX, the Red{nbsp}Hat build of OpenTelemetry, or all three at the same time. For Kafka or IPFIX, any processor or storage that supports those inputs, such as Splunk, Elasticsearch, or Fluentd, can consume the enriched network flow data. For OpenTelemetry, network flow data and metrics can be exported to a compatible OpenTelemetry endpoint, such as Red{nbsp}Hat build of OpenTelemetry, Jaeger, or Prometheus.
1010

1111
.Prerequisites
12-
* Your Kafka or IPFIX collector endpoint(s) are available from Network Observability `flowlogs-pipeline` pods.
12+
* Your Kafka, IPFIX, or OpenTelemetry collector endpoints are available from Network Observability `flowlogs-pipeline` pods.
13+
1314
1415
.Procedure
1516

@@ -26,22 +27,41 @@ metadata:
2627
name: cluster
2728
spec:
2829
exporters:
29-
- type: Kafka <3>
30+
- type: Kafka <1>
3031
kafka:
3132
address: "kafka-cluster-kafka-bootstrap.netobserv"
32-
topic: netobserv-flows-export <1>
33+
topic: netobserv-flows-export <2>
3334
tls:
34-
enable: false <2>
35-
- type: IPFIX <3>
35+
enable: false <3>
36+
- type: IPFIX <1>
3637
ipfix:
3738
targetHost: "ipfix-collector.ipfix.svc.cluster.local"
3839
targetPort: 4739
3940
transport: tcp or udp <4>
40-
41-
41+
- type: OpenTelemetry <1>
42+
openTelemetry:
43+
targetHost: my-otelcol-collector-headless.otlp.svc
44+
targetPort: 4317
45+
type: grpc <5>
46+
logs: <6>
47+
enable: true
48+
metrics: <7>
49+
enable: true
50+
prefix: netobserv
51+
pushTimeInterval: 20s <8>
52+
expiryTime: 2m
53+
# fieldsMapping: <9>
54+
# input: SrcAddr
55+
# output: source.address
4256
----
43-
<1> The Network Observability Operator exports all flows to the configured Kafka topic.
44-
<2> You can encrypt all communications to and from Kafka with SSL/TLS or mTLS. When enabled, the Kafka CA certificate must be available as a ConfigMap or a Secret, both in the namespace where the `flowlogs-pipeline` processor component is deployed (default: netobserv). It must be referenced with `spec.exporters.tls.caCert`. When using mTLS, client secrets must be available in these namespaces as well (they can be generated for instance using the AMQ Streams User Operator) and referenced with `spec.exporters.tls.userCert`.
45-
<3> You can export flows to IPFIX instead of or in conjunction with exporting flows to Kafka.
57+
<1> You can export flows to IPFIX, OpenTelemetry, and Kafka individually or concurrently.
58+
<2> The Network Observability Operator exports all flows to the configured Kafka topic.
59+
<3> You can encrypt all communications to and from Kafka with SSL/TLS or mTLS. When enabled, the Kafka CA certificate must be available as a ConfigMap or a Secret, both in the namespace where the `flowlogs-pipeline` processor component is deployed (default: netobserv). It must be referenced with `spec.exporters.tls.caCert`. When using mTLS, client secrets must be available in these namespaces as well (they can be generated for instance using the AMQ Streams User Operator) and referenced with `spec.exporters.tls.userCert`.
4660
<4> You have the option to specify transport. The default value is `tcp` but you can also specify `udp`.
47-
. After configuration, network flows data can be sent to an available output in a JSON format. For more information, see _Network flows format reference_.
61+
<5> The protocol of OpenTelemetry connection. The available options are `http` and `grpc`.
62+
<6> OpenTelemetry configuration for exporting logs, which are the same as the logs created for Loki.
63+
<7> OpenTelemetry configuration for exporting metrics, which are the same as the metrics created for Prometheus. These configurations are specified in the `spec.processor.metrics.includeList` parameter of the `FlowCollector` custom resource, along with any custom metrics you defined using the `FlowMetrics` custom resource.
64+
<8> The time interval that metrics are sent to the OpenTelemetry collector.
65+
<9> *Optional*:Network Observability network flows formats get automatically renamed to an OpenTelemetry compliant format. The `fieldsMapping` specification gives you the ability to customize the OpenTelemetry format output. For example in the YAML sample, `SrcAddr` is the Network Observability input field, and it is being renamed `source.address` in OpenTelemetry output. You can see both Network Observability and OpenTelemetry formats in the "Network flows format reference".
66+
67+
After configuration, network flows data can be sent to an available output in a JSON format. For more information, see "Network flows format reference".

0 commit comments

Comments
 (0)