Skip to content

Commit 8647d10

Browse files
committed
Deploy FLP as a service
This is an intermediate alternative between the Kafka mode and the Direct mode, that is more suitable for quick install on large clusters (Kafka mode is a more complex setup, whereas Direct mode isn't suitable on large clusters due to the memory consumption of FLP) To use it, set `deploymentModel` to `Service`. There are potential caveat to check: - Without sticky session, no guarantee that the agents talk to the same FLP instance. I don't think it's an issue in the nominal case, but might be a problem for conversation tracking?
1 parent 87afef4 commit 8647d10

22 files changed

+349
-77
lines changed

api/flowcollector/v1beta2/flowcollector_types.go

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ import (
2727
type FlowCollectorDeploymentModel string
2828

2929
const (
30-
DeploymentModelDirect FlowCollectorDeploymentModel = "Direct"
31-
DeploymentModelKafka FlowCollectorDeploymentModel = "Kafka"
30+
DeploymentModelDirect FlowCollectorDeploymentModel = "Direct"
31+
DeploymentModelKafka FlowCollectorDeploymentModel = "Kafka"
32+
DeploymentModelService FlowCollectorDeploymentModel = "Service"
3233
)
3334

3435
// Please notice that the FlowCollectorSpec's properties MUST redefine one of the default
@@ -69,11 +70,12 @@ type FlowCollectorSpec struct {
6970
ConsolePlugin FlowCollectorConsolePlugin `json:"consolePlugin,omitempty"`
7071

7172
// `deploymentModel` defines the desired type of deployment for flow processing. Possible values are:<br>
72-
// - `Direct` (default) to make the flow processor listen directly from the agents.<br>
73+
// - `Direct` (default) to make the flow processor listen directly from the agents using the host network.<br>
74+
// - `Service` to make the flow processor listen as a Kubernetes Service.<br>
7375
// - `Kafka` to make flows sent to a Kafka pipeline before consumption by the processor.<br>
7476
// Kafka can provide better scalability, resiliency, and high availability (for more details, see https://www.redhat.com/en/topics/integration/what-is-apache-kafka).
7577
// +unionDiscriminator
76-
// +kubebuilder:validation:Enum:="Direct";"Kafka"
78+
// +kubebuilder:validation:Enum:="Direct";"Service";"Kafka"
7779
// +kubebuilder:default:=Direct
7880
DeploymentModel FlowCollectorDeploymentModel `json:"deploymentModel,omitempty"`
7981

@@ -633,15 +635,26 @@ type FlowCollectorFLP struct {
633635

634636
//+kubebuilder:validation:Minimum=0
635637
//+kubebuilder:default:=3
636-
// `kafkaConsumerReplicas` defines the number of replicas (pods) to start for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
638+
// `kafkaConsumerReplicas` [deprecated (*)] defines the number of replicas (pods) to start for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
637639
// This setting is ignored when Kafka is disabled.
640+
// Deprecation notice: use `spec.processor.consumerReplicas` instead.
638641
KafkaConsumerReplicas *int32 `json:"kafkaConsumerReplicas,omitempty"`
639642

640-
// `kafkaConsumerAutoscaler` is the spec of a horizontal pod autoscaler to set up for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
643+
// `kafkaConsumerAutoscaler` [deprecated (*)] is the spec of a horizontal pod autoscaler to set up for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
641644
// This setting is ignored when Kafka is disabled.
645+
// Deprecation notice: managed autoscaler will be removed in a future version. You may configure instead an autoscaler of your choice, and set `spec.processor.unmanagedReplicas` to `true`.
642646
// +optional
643647
KafkaConsumerAutoscaler FlowCollectorHPA `json:"kafkaConsumerAutoscaler,omitempty"`
644648

649+
//+kubebuilder:validation:Minimum=0
650+
// `consumerReplicas` defines the number of replicas (pods) to start for `flowlogs-pipeline`.
651+
// This setting is ignored when `spec.deploymentModel` is `Direct` or when `spec.processor.unmanagedReplicas` is `true`.
652+
ConsumerReplicas *int32 `json:"consumerReplicas,omitempty"`
653+
654+
// If `unmanagedReplicas` is `true`, the operator will not reconcile `consumerReplicas`. This is useful when using a pod autoscaler.
655+
// +optional
656+
UnmanagedReplicas bool `json:"unmanagedReplicas,omitempty"`
657+
645658
//+kubebuilder:default:=1000
646659
// +optional
647660
// `kafkaConsumerQueueCapacity` defines the capacity of the internal message queue used in the Kafka consumer client. Ignored when not using Kafka.
@@ -1032,6 +1045,10 @@ type FlowCollectorConsolePlugin struct {
10321045
// `replicas` defines the number of replicas (pods) to start.
10331046
Replicas *int32 `json:"replicas,omitempty"`
10341047

1048+
// If `unmanagedReplicas` is `true`, the operator will not reconcile `replicas`. This is useful when using a pod autoscaler.
1049+
// +optional
1050+
UnmanagedReplicas bool `json:"unmanagedReplicas,omitempty"`
1051+
10351052
//+kubebuilder:validation:Enum=IfNotPresent;Always;Never
10361053
//+kubebuilder:default:=IfNotPresent
10371054
// `imagePullPolicy` is the Kubernetes pull policy for the image defined above
@@ -1048,7 +1065,8 @@ type FlowCollectorConsolePlugin struct {
10481065
// `logLevel` for the console plugin backend
10491066
LogLevel string `json:"logLevel,omitempty"`
10501067

1051-
// `autoscaler` spec of a horizontal pod autoscaler to set up for the plugin Deployment.
1068+
// `autoscaler` [deprecated (*)] spec of a horizontal pod autoscaler to set up for the plugin Deployment.
1069+
// Deprecation notice: managed autoscaler will be removed in a future version. You may configure instead an autoscaler of your choice, and set `spec.consolePlugin.unmanagedReplicas` to `true`.
10521070
// +optional
10531071
Autoscaler FlowCollectorHPA `json:"autoscaler,omitempty"`
10541072

api/flowcollector/v1beta2/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/flows.netobserv.io_flowcollectors.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,8 +2750,9 @@ spec:
27502750
type: object
27512751
type: object
27522752
autoscaler:
2753-
description: '`autoscaler` spec of a horizontal pod autoscaler
2754-
to set up for the plugin Deployment.'
2753+
description: |-
2754+
`autoscaler` [deprecated (*)] spec of a horizontal pod autoscaler to set up for the plugin Deployment.
2755+
Deprecation notice: managed autoscaler will be removed in a future version. You may configure instead an autoscaler of your choice, and set `spec.consolePlugin.unmanagedReplicas` to `true`.
27552756
properties:
27562757
maxReplicas:
27572758
default: 3
@@ -3211,16 +3212,22 @@ spec:
32113212
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
32123213
type: object
32133214
type: object
3215+
unmanagedReplicas:
3216+
description: If `unmanagedReplicas` is `true`, the operator will
3217+
not reconcile `replicas`. This is useful when using a pod autoscaler.
3218+
type: boolean
32143219
type: object
32153220
deploymentModel:
32163221
default: Direct
32173222
description: |-
32183223
`deploymentModel` defines the desired type of deployment for flow processing. Possible values are:<br>
3219-
- `Direct` (default) to make the flow processor listen directly from the agents.<br>
3224+
- `Direct` (default) to make the flow processor listen directly from the agents using the host network.<br>
3225+
- `Service` to make the flow processor listen as a Kubernetes Service.<br>
32203226
- `Kafka` to make flows sent to a Kafka pipeline before consumption by the processor.<br>
32213227
Kafka can provide better scalability, resiliency, and high availability (for more details, see https://www.redhat.com/en/topics/integration/what-is-apache-kafka).
32223228
enum:
32233229
- Direct
3230+
- Service
32243231
- Kafka
32253232
type: string
32263233
exporters:
@@ -5366,6 +5373,13 @@ spec:
53665373
in the flows data. This is useful in a multi-cluster context.
53675374
When using OpenShift, leave empty to make it automatically determined.'
53685375
type: string
5376+
consumerReplicas:
5377+
description: |-
5378+
`consumerReplicas` defines the number of replicas (pods) to start for `flowlogs-pipeline`.
5379+
This setting is ignored when `spec.deploymentModel` is `Direct` or when `spec.processor.unmanagedReplicas` is `true`.
5380+
format: int32
5381+
minimum: 0
5382+
type: integer
53695383
deduper:
53705384
description: '`deduper` allows you to sample or drop flows identified
53715385
as duplicates, in order to save on resource usage.'
@@ -5434,8 +5448,9 @@ spec:
54345448
type: string
54355449
kafkaConsumerAutoscaler:
54365450
description: |-
5437-
`kafkaConsumerAutoscaler` is the spec of a horizontal pod autoscaler to set up for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
5451+
`kafkaConsumerAutoscaler` [deprecated (*)] is the spec of a horizontal pod autoscaler to set up for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
54385452
This setting is ignored when Kafka is disabled.
5453+
Deprecation notice: managed autoscaler will be removed in a future version. You may configure instead an autoscaler of your choice, and set `spec.processor.unmanagedReplicas` to `true`.
54395454
properties:
54405455
maxReplicas:
54415456
default: 3
@@ -5749,8 +5764,9 @@ spec:
57495764
kafkaConsumerReplicas:
57505765
default: 3
57515766
description: |-
5752-
`kafkaConsumerReplicas` defines the number of replicas (pods) to start for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
5767+
`kafkaConsumerReplicas` [deprecated (*)] defines the number of replicas (pods) to start for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
57535768
This setting is ignored when Kafka is disabled.
5769+
Deprecation notice: use `spec.processor.consumerReplicas` instead.
57545770
format: int32
57555771
minimum: 0
57565772
type: integer
@@ -6052,6 +6068,11 @@ spec:
60526068
external traffic: flows that are not labeled for those subnets are external to the cluster. Enabled by default on OpenShift.
60536069
type: boolean
60546070
type: object
6071+
unmanagedReplicas:
6072+
description: If `unmanagedReplicas` is `true`, the operator will
6073+
not reconcile `consumerReplicas`. This is useful when using
6074+
a pod autoscaler.
6075+
type: boolean
60556076
type: object
60566077
prometheus:
60576078
description: '`prometheus` defines Prometheus settings, such as querier

bundle/manifests/netobserv-operator.clusterserviceversion.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ metadata:
253253
categories: Monitoring, Networking, Observability
254254
console.openshift.io/plugins: '["netobserv-plugin"]'
255255
containerImage: quay.io/netobserv/network-observability-operator:1.9.1-community
256-
createdAt: "2025-07-21T09:56:28Z"
256+
createdAt: "2025-09-05T12:57:16Z"
257257
description: Network flows collector and monitoring solution
258258
operatorframework.io/initialization-resource: '{"apiVersion":"flows.netobserv.io/v1beta2",
259259
"kind":"FlowCollector","metadata":{"name":"cluster"},"spec": {}}'
@@ -568,6 +568,8 @@ spec:
568568
path: consolePlugin.portNaming.enable
569569
- displayName: Port names
570570
path: consolePlugin.portNaming.portNames
571+
- displayName: Unmanaged replicas
572+
path: consolePlugin.unmanagedReplicas
571573
- displayName: Address
572574
path: kafka.address
573575
- displayName: Topic
@@ -606,6 +608,8 @@ spec:
606608
path: networkPolicy.additionalNamespaces
607609
- displayName: Enable
608610
path: networkPolicy.enable
611+
- displayName: Consumer replicas
612+
path: processor.consumerReplicas
609613
- displayName: Deduper
610614
path: processor.deduper
611615
- displayName: Mode
@@ -626,6 +630,8 @@ spec:
626630
path: processor.subnetLabels
627631
- displayName: Custom labels
628632
path: processor.subnetLabels.customLabels
633+
- displayName: Unmanaged replicas
634+
path: processor.unmanagedReplicas
629635
- displayName: Prometheus
630636
path: prometheus
631637
- displayName: Querier
@@ -724,7 +730,7 @@ spec:
724730
725731
- Quick filters (`spec.consolePlugin.quickFilters`): configure preset filters to be displayed in the Console plugin. They offer a way to quickly switch from filters to others, such as showing / hiding pods network, or infrastructure network, or application network, etc. They can be tuned to reflect the different workloads running on your cluster. For a list of available filters, [check this page](https://github.com/netobserv/network-observability-operator/blob/1.9.1-community/docs/QuickFilters.md).
726732
727-
- Kafka (`spec.deploymentModel: KAFKA` and `spec.kafka`): when enabled, integrates the flow collection pipeline with Kafka, by splitting ingestion from transformation (kube enrichment, derived metrics, ...). Kafka can provide better scalability, resiliency and high availability ([view more details](https://www.redhat.com/en/topics/integration/what-is-apache-kafka)). Assumes Kafka is already deployed and a topic is created.
733+
- Kafka (`spec.deploymentModel: Kafka` and `spec.kafka`): when enabled, integrates the flow collection pipeline with Kafka, by splitting ingestion from transformation (kube enrichment, derived metrics, ...). Kafka can provide better scalability, resiliency and high availability ([view more details](https://www.redhat.com/en/topics/integration/what-is-apache-kafka)). Assumes Kafka is already deployed and a topic is created.
728734
729735
- Exporters (`spec.exporters`) an optional list of exporters to which to send enriched flows. KAFKA and IPFIX exporters are supported. This allows you to define any custom storage or processing that can read from Kafka or use the IPFIX standard.
730736
@@ -1070,7 +1076,7 @@ spec:
10701076
- name: RELATED_IMAGE_CONSOLE_PLUGIN
10711077
value: quay.io/netobserv/network-observability-console-plugin:v1.9.1-community
10721078
- name: RELATED_IMAGE_CONSOLE_PLUGIN_COMPAT
1073-
value: quay.io/netobserv/network-observability-console-plugin-pf4:v1.8.2-community
1079+
value: quay.io/netobserv/network-observability-console-plugin:v1.9.1-community
10741080
- name: DOWNSTREAM_DEPLOYMENT
10751081
value: "false"
10761082
- name: PROFILING_BIND_ADDRESS
@@ -1215,9 +1221,7 @@ spec:
12151221
- image: quay.io/netobserv/flowlogs-pipeline:v1.9.1-community
12161222
name: flowlogs-pipeline
12171223
- image: quay.io/netobserv/network-observability-console-plugin:v1.9.1-community
1218-
name: console-plugin
1219-
- image: quay.io/netobserv/network-observability-console-plugin-pf4:v1.8.2-community
1220-
name: console-plugin-compat
1224+
name: ""
12211225
version: 1.9.1-community
12221226
webhookdefinitions:
12231227
- admissionReviewVersions:

config/crd/bases/flows.netobserv.io_flowcollectors.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,9 @@ spec:
25572557
type: object
25582558
type: object
25592559
autoscaler:
2560-
description: '`autoscaler` spec of a horizontal pod autoscaler to set up for the plugin Deployment.'
2560+
description: |-
2561+
`autoscaler` [deprecated (*)] spec of a horizontal pod autoscaler to set up for the plugin Deployment.
2562+
Deprecation notice: managed autoscaler will be removed in a future version. You may configure instead an autoscaler of your choice, and set `spec.consolePlugin.unmanagedReplicas` to `true`.
25612563
properties:
25622564
maxReplicas:
25632565
default: 3
@@ -3006,16 +3008,21 @@ spec:
30063008
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
30073009
type: object
30083010
type: object
3011+
unmanagedReplicas:
3012+
description: If `unmanagedReplicas` is `true`, the operator will not reconcile `replicas`. This is useful when using a pod autoscaler.
3013+
type: boolean
30093014
type: object
30103015
deploymentModel:
30113016
default: Direct
30123017
description: |-
30133018
`deploymentModel` defines the desired type of deployment for flow processing. Possible values are:<br>
3014-
- `Direct` (default) to make the flow processor listen directly from the agents.<br>
3019+
- `Direct` (default) to make the flow processor listen directly from the agents using the host network.<br>
3020+
- `Service` to make the flow processor listen as a Kubernetes Service.<br>
30153021
- `Kafka` to make flows sent to a Kafka pipeline before consumption by the processor.<br>
30163022
Kafka can provide better scalability, resiliency, and high availability (for more details, see https://www.redhat.com/en/topics/integration/what-is-apache-kafka).
30173023
enum:
30183024
- Direct
3025+
- Service
30193026
- Kafka
30203027
type: string
30213028
exporters:
@@ -4946,6 +4953,13 @@ spec:
49464953
default: ""
49474954
description: '`clusterName` is the name of the cluster to appear in the flows data. This is useful in a multi-cluster context. When using OpenShift, leave empty to make it automatically determined.'
49484955
type: string
4956+
consumerReplicas:
4957+
description: |-
4958+
`consumerReplicas` defines the number of replicas (pods) to start for `flowlogs-pipeline`.
4959+
This setting is ignored when `spec.deploymentModel` is `Direct` or when `spec.processor.unmanagedReplicas` is `true`.
4960+
format: int32
4961+
minimum: 0
4962+
type: integer
49494963
deduper:
49504964
description: '`deduper` allows you to sample or drop flows identified as duplicates, in order to save on resource usage.'
49514965
properties:
@@ -5004,8 +5018,9 @@ spec:
50045018
type: string
50055019
kafkaConsumerAutoscaler:
50065020
description: |-
5007-
`kafkaConsumerAutoscaler` is the spec of a horizontal pod autoscaler to set up for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
5021+
`kafkaConsumerAutoscaler` [deprecated (*)] is the spec of a horizontal pod autoscaler to set up for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
50085022
This setting is ignored when Kafka is disabled.
5023+
Deprecation notice: managed autoscaler will be removed in a future version. You may configure instead an autoscaler of your choice, and set `spec.processor.unmanagedReplicas` to `true`.
50095024
properties:
50105025
maxReplicas:
50115026
default: 3
@@ -5312,8 +5327,9 @@ spec:
53125327
kafkaConsumerReplicas:
53135328
default: 3
53145329
description: |-
5315-
`kafkaConsumerReplicas` defines the number of replicas (pods) to start for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
5330+
`kafkaConsumerReplicas` [deprecated (*)] defines the number of replicas (pods) to start for `flowlogs-pipeline-transformer`, which consumes Kafka messages.
53165331
This setting is ignored when Kafka is disabled.
5332+
Deprecation notice: use `spec.processor.consumerReplicas` instead.
53175333
format: int32
53185334
minimum: 0
53195335
type: integer
@@ -5597,6 +5613,9 @@ spec:
55975613
external traffic: flows that are not labeled for those subnets are external to the cluster. Enabled by default on OpenShift.
55985614
type: boolean
55995615
type: object
5616+
unmanagedReplicas:
5617+
description: If `unmanagedReplicas` is `true`, the operator will not reconcile `consumerReplicas`. This is useful when using a pod autoscaler.
5618+
type: boolean
56005619
type: object
56015620
prometheus:
56025621
description: '`prometheus` defines Prometheus settings, such as querier configuration used to fetch metrics from the Console plugin.'

0 commit comments

Comments
 (0)