Questo contenuto non è disponibile nella lingua selezionata.
Chapter 7. Network observability per-tenant model
Use the FlowCollectorSlice resource to delegate network traffic analysis management to project administrators while maintaining global cluster governance.
7.1. Per-tenant hierarchical governance and tenant autonomy Copia collegamentoCollegamento copiato negli appunti!
Cluster administrators can maintain global governance while allowing project administrators to manage network traffic observability within their specific namespaces.
The Network Observability Operator uses a hierarchical configuration model to support multitenancy. This architecture is beneficial for large-scale deployments and hosted control planes environments where individual teams require self-service visibility without cluster administrator intervention.
The hierarchical model consists of the following components:
- Global governance
-
The cluster administrator manages the global
FlowCollectorresource. This resource defines the observability infrastructure and determines if per-tenant configuration is permitted. - Tenant autonomy
-
The project administrator manages the
FlowCollectorSliceresource. This namespace-scoped custom resource (CR) allows teams to define specific observability settings for their workloads.
7.2. FlowCollectorSlice resource for granular flow collection Copia collegamentoCollegamento copiato negli appunti!
The FlowCollectorSlice is a custom resource definition (CRD) that enables granular, multi-tenant network flow collection. By defining logical slices based on namespaces or subnets, you can selectively collect traffic and apply custom sampling to specific workloads rather than the entire cluster.
It complements the existing FlowCollector custom resource by enabling granular, selective, and multi-tenant-aware flow collection, instead of a single global configuration that applies uniformly to all traffic.
When slice-based collection is enabled, only traffic that matches at least one FlowCollectorSlice is collected, allowing administrators to precisely control which network flows are observed.
7.2.1. Benefits of FlowCollectorSlice Copia collegamentoCollegamento copiato negli appunti!
By default, network flow collection applies uniformly to all traffic in the cluster. This can result in excessive data volume and limited flexibility.
Using FlowCollectorSlice provides the following benefits:
- Enables selective flow collection for specific namespaces or workloads.
- Supports multi-tenant and environment-based observability.
- Reduces storage and processing costs by filtering irrelevant traffic.
- Preserves backward compatibility through opt-in configuration.
7.2.2. Relationship between FlowCollector and FlowCollectorSlice Copia collegamentoCollegamento copiato negli appunti!
While the FlowCollector resource defines global flow collection behavior for the cluster, the FlowCollectorSlice resource defines which traffic is eligible for collection when slice-based filtering is enabled.
The FlowCollector.spec.slicesConfig field controls how slice definitions are applied.
7.2.3. Collection modes Copia collegamentoCollegamento copiato negli appunti!
Slice behavior is governed by the FlowCollector.spec.slicesConfig.collectionMode field. Set the field to one of the following collection modes:
- AlwaysCollect
- Collects network flows from all cluster namespaces.
-
Applies the subnet and sampling configurations defined in
FlowCollectorSliceresources. -
Ignores the namespace selection logic in
FlowCollectorSliceresources. - Maintains the default collection behavior for backward compatibility.
- AllowList
-
Collects only traffic that matches at least one
FlowCollectorSliceresource. - An optional namespace allow list includes selected namespaces in the collection.
-
Collects only traffic that matches at least one
7.2.4. FlowCollectorSlice status Copia collegamentoCollegamento copiato negli appunti!
Each FlowCollectorSlice resource exposes a status subresource that reports:
- Validation results.
- Reconciliation state.
- Whether the slice is successfully applied.
This status allows administrators to verify that slice definitions are active and functioning as expected.
7.3. Enable the Network Observability Operator FlowCollectorSlice Copia collegamentoCollegamento copiato negli appunti!
Enabling the FlowCollectorSlice feature in the FlowCollector resource allows cluster administrators to delegate flow collection and data enrichment management to specific namespaces.
Before project administrators can manage their own settings, a cluster administrator must enable the FlowCollector custom resource to watch for the FlowCollectorSlice custom resource.
Prerequisites
- The Network Observability Operator is installed.
-
A
FlowCollectorcustom resource exists in the cluster. -
You have
cluster-adminprivileges.
Procedure
Edit the
FlowCollectorcustom resource by running the following command:$ oc edit flowcollector clusterConfigure the
spec.processor.slicesConfigfield to define which namespaces are permitted to use slices:apiVersion: flows.netobserv.io/v1beta2 kind: FlowCollector metadata: name: cluster spec: processor: slicesConfig: enable: true collectionMode: AllowList namespacesAllowList: - /openshift-.*|netobserv.*/where:
spec.processor.sliceConfig.enable-
Specifies if the
FlowCollectorSlicefeature is enabled. If not, all resources of kindFlowCollectorSliceare ignored. spec.processor.sliceConfig.collectionMode-
Specifies how the
FlowCollectorSlicecustom resources impacts the flow collection process. When set toAlwaysCollect, all flows are collected regardless of the presence ofFlowCollectorSlice. When set toAllowList, only the flows related to namespaces where aFlowCollectorSliceresource is present, or configured via the globalnamespacesAllowList, are collected. spec.processor.sliceConfig.namespacesAllowListSpecifies a list of namespaces for which flows are always collected, regardless of the presence of
FlowCollectorSlicein those namespaces.NoteThe
namespacesAllowListfield supports regular expressions, such as/openshift-.*/to capture multiple namespaces, or strict equality, such asnetobserv, to match a specific namespace.
- Save the changes and exit the editor.
Verification
-
Verify that only network flows from the
netobservnamespace and namespaces starting withopenshift-are displayed in the Network Traffic page of the web console.
7.3.1. Disable the Network Observability Operator FlowCollectorSlice Copia collegamentoCollegamento copiato negli appunti!
Disable slice-based filtering in the Network Observability Operator to resume global flow collection while preserving existing FlowCollectorSlice resources.
Procedure
Edit the
FlowCollectorresource by running the following command:$ oc edit flowcollector clusterSet the
spec.processor.slicesConfig.collectionModefield toAlwaysCollect:apiVersion: flows.netobserv.io/v1beta2 kind: FlowCollector metadata: name: cluster spec: processor: slicesConfig: enable: true collectionMode: AlwaysCollect ...Save the changes.
Flow collection resumes for all traffic, and existing
FlowCollectorSliceresources remain available for future use.
7.4. Configure the FlowCollectorSlice as a project administrator Copia collegamentoCollegamento copiato negli appunti!
Project administrators can manage flow collection and data enrichment within their own namespaces by configuring a FlowCollectorSlice custom resource for decentralized network traffic analysis.
Prerequisites
- The Network Observability Operator is installed.
-
You have
project-adminpermissions for the namespace.
Procedure
Create a YAML file named
flowCollectorSlice.yaml:apiVersion: flows.netobserv.io/v1alpha1 kind: FlowCollectorSlice metadata: name: flowcollectorslice-sample namespace: my-app spec: sampling: 1 subnetLabels: - name: EXT:Database cidrs: - 192.168.50.0/24Apply the configuration by running the following command:
$ oc apply -f flowCollectorSlice.yaml
Verification
-
In the OpenShift Container Platform console, navigate to Observe
Network Traffic. -
Ensure flows to
192.168.50.0/24subnet are observed with theEXT:Databaselabel.
7.5. FlowCollectorSlice [flows.netobserv.io/v1alpha1] Copia collegamentoCollegamento copiato negli appunti!
- Description
- FlowCollectorSlice is the API allowing to decentralize some of the FlowCollector configuration per namespace tenant.
- Type
-
object
| Property | Type | Description |
|---|---|---|
|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and might reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
|
| Kind is a string value representing the REST resource this object represents. Servers might infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
|
| Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
|
|
| FlowCollectorSliceSpec defines the desired state of FlowCollectorSlice |
7.5.1. .metadata Copia collegamentoCollegamento copiato negli appunti!
- Description
- Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- Type
-
object
7.5.2. .spec Copia collegamentoCollegamento copiato negli appunti!
- Description
- FlowCollectorSliceSpec defines the desired state of FlowCollectorSlice
- Type
-
object
| Property | Type | Description |
|---|---|---|
|
|
|
|
|
|
|
Beware that the subnet labels configured in FlowCollectorSlice are not limited to the flows of the related namespace: any flow in the whole cluster can be labeled using this configuration. However, subnet labels defined in the cluster-scoped FlowCollector take precedence in case of conflicting rules. |
7.5.3. .spec.subnetLabels Copia collegamentoCollegamento copiato negli appunti!
- Description
subnetLabelsallows you to customize subnets and IPs labeling, such as to identify cluster external workloads or web services. External subnets must be labeled with the prefixEXT:, or not labeled at all, in order to work with default quick filters and some metrics examples provided.
Beware that the subnet labels configured in FlowCollectorSlice are not limited to the flows of the related namespace: any flow in the whole cluster can be labeled using this configuration. However, subnet labels defined in the cluster-scoped FlowCollector take precedence in case of conflicting rules.
- Type
-
array
7.5.4. .spec.subnetLabels[] Copia collegamentoCollegamento copiato negli appunti!
- Description
- SubnetLabel allows to label subnets and IPs, such as to identify cluster-external workloads or web services.
- Type
-
object - Required
-
cidrs -
name
-
| Property | Type | Description |
|---|---|---|
|
|
|
List of CIDRs, such as |
|
|
|
Label name, used to flag matching flows. External subnets must be labeled with the prefix |