Skip to content

feat: Integrate listener operator #784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
60eb387
add support for listeners
labrenbe Apr 25, 2025
93120b3
add very basic integration test
labrenbe Apr 25, 2025
844d198
Merge remote-tracking branch 'origin/main' into feat/integrate-listen…
labrenbe May 16, 2025
eb5136a
add pr number to changelog
labrenbe May 16, 2025
c1aede3
add external-access test
labrenbe May 16, 2025
46b3c14
chore: Add NiFi 2.4.0 and remove 2.2.0 (#797)
labrenbe May 20, 2025
d33ffab
test: Add test for Apache Iceberg integration (#785)
sbernauer May 21, 2025
1b80397
wip: update listener implementation based on implementation for super…
labrenbe May 23, 2025
ed5f1dc
Merge remote-tracking branch 'origin/main' into feat/integrate-listen…
labrenbe Jun 3, 2025
fcb0c4a
use single listener with pvc per rolegroup
labrenbe Jun 3, 2025
b5202ff
update integration tests with crd change
labrenbe Jun 3, 2025
a29e789
restore iceberg test file
labrenbe Jun 10, 2025
a99adff
fix listener class in iceberg test
labrenbe Jun 10, 2025
95ae9f5
Merge remote-tracking branch 'origin/main' into feat/integrate-listen…
labrenbe Jun 10, 2025
dd63d75
expose https port in headless service
labrenbe Jun 10, 2025
afc55ac
update comment
labrenbe Jun 10, 2025
bf88cc1
address feedback from review
labrenbe Jun 10, 2025
7262d89
remove unused error variants
labrenbe Jun 12, 2025
e950a5a
create headless service name in function
labrenbe Jun 12, 2025
41819bb
remove unused functions
labrenbe Jun 12, 2025
190ca21
move listenerClass to roleConfig
labrenbe Jun 18, 2025
38cbf54
Merge remote-tracking branch 'origin/main' into feat/integrate-listen…
labrenbe Jun 18, 2025
ef07f0c
use new headless service name in integration tests
labrenbe Jun 20, 2025
b029440
move listener constants to listener module
labrenbe Jun 23, 2025
a4e3313
remove duplicate iceberg test
labrenbe Jun 23, 2025
eb06291
remove hard-coded names
labrenbe Jun 23, 2025
3c7850f
fix integration tests
labrenbe Jun 23, 2025
79a1930
remove hardcoded role name
labrenbe Jun 23, 2025
f38deac
improve code quality
labrenbe Jun 23, 2025
bbbc4ad
set rolegroup label on listener pvcs to none
labrenbe Jun 23, 2025
c5c2264
fix app version label on listener
labrenbe Jun 24, 2025
5629842
set rolegroup label on listener pvcs
labrenbe Jun 24, 2025
83027b8
Merge remote-tracking branch 'origin/main' into feat/integrate-listen…
labrenbe Jun 24, 2025
2860720
remove listener class from trino in iceberg test
labrenbe Jun 24, 2025
b8c87e3
add note on custom ListenerClasses to docs
labrenbe Jun 26, 2025
074d138
remove version argument in reporting task
labrenbe Jun 26, 2025
3f8d840
rename headless service
labrenbe Jun 30, 2025
c7ce9b6
fix iceberg test
labrenbe Jun 30, 2025
8658f8b
create separate headless services
labrenbe Jul 2, 2025
b83120d
add missing file
labrenbe Jul 2, 2025
bb49f43
fix iceberg test
labrenbe Jul 2, 2025
05ada01
use listener scope for tls
labrenbe Jul 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Added

- Add rolling upgrade support for upgrades between NiFi 2 versions ([#771]).
- Added Listener support for NiFi ([#784]).
- Adds new telemetry CLI arguments and environment variables ([#782]).
- Use `--file-log-max-files` (or `FILE_LOG_MAX_FILES`) to limit the number of log files kept.
- Use `--file-log-rotation-period` (or `FILE_LOG_ROTATION_PERIOD`) to configure the frequency of rotation.
Expand Down Expand Up @@ -52,6 +53,7 @@ All notable changes to this project will be documented in this file.
[#782]: https://github.com/stackabletech/nifi-operator/pull/782
[#785]: https://github.com/stackabletech/nifi-operator/pull/785
[#787]: https://github.com/stackabletech/nifi-operator/pull/787
[#784]: https://github.com/stackabletech/nifi-operator/pull/784
[#789]: https://github.com/stackabletech/nifi-operator/pull/789
[#793]: https://github.com/stackabletech/nifi-operator/pull/793
[#794]: https://github.com/stackabletech/nifi-operator/pull/794
Expand Down
18 changes: 4 additions & 14 deletions deploy/helm/nifi-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,6 @@ spec:
description: Allow all proxy hosts by turning off host header validation. See <https://github.com/stackabletech/docker-images/pull/694>
type: boolean
type: object
listenerClass:
default: cluster-internal
description: |-
This field controls which type of Service the Operator creates for this NifiCluster:

* cluster-internal: Use a ClusterIP service

* external-unstable: Use a NodePort service

This is a temporary solution with the goal to keep yaml manifests forward compatible. In the future, this setting will control which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change.
enum:
- cluster-internal
- external-unstable
type: string
sensitiveProperties:
description: These settings configure the encryption of sensitive properties in NiFi processors. NiFi supports encrypting sensitive properties in processors as they are written to disk. You can configure the encryption algorithm and the key to use. You can also let the operator generate an encryption key for you.
properties:
Expand Down Expand Up @@ -790,11 +776,15 @@ spec:
x-kubernetes-preserve-unknown-fields: true
roleConfig:
default:
listenerClass: cluster-internal
podDisruptionBudget:
enabled: true
maxUnavailable: null
description: This is a product-agnostic RoleConfig, which is sufficient for most of the products.
properties:
listenerClass:
default: cluster-internal
type: string
podDisruptionBudget:
default:
enabled: true
Expand Down
11 changes: 11 additions & 0 deletions deploy/helm/nifi-operator/templates/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ rules:
verbs:
- create
- patch
- apiGroups:
- listeners.stackable.tech
resources:
- listeners
verbs:
- get
- list
- watch
- patch
- create
- delete
- apiGroups:
- {{ include "operator.name" . }}.stackable.tech
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,17 @@ spec:
clusterConfig:
authentication:
- authenticationClass: simple-nifi-users
listenerClass: external-unstable
sensitiveProperties:
keySecret: nifi-sensitive-property-key
autoGenerate: true
zookeeperConfigMapName: simple-nifi-znode
nodes:
roleConfig:
listenerClass: external-unstable
roleGroups:
default:
replicas: 1

EOF
# end::install-nifi[]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,13 @@ spec:
clusterConfig:
authentication:
- authenticationClass: simple-nifi-users
listenerClass: external-unstable
sensitiveProperties:
keySecret: nifi-sensitive-property-key
autoGenerate: true
zookeeperConfigMapName: simple-nifi-znode
nodes:
roleConfig:
listenerClass: external-unstable
roleGroups:
default:
replicas: 1
Expand Down
6 changes: 4 additions & 2 deletions docs/modules/nifi/pages/usage_guide/custom-components.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ spec:
- name: nifi-processors
configMap:
name: nifi-processors
listenerClass: external-unstable
sensitiveProperties:
keySecret: nifi-sensitive-property-key
autoGenerate: true
zookeeperConfigMapName: simple-nifi-znode
nodes:
roleConfig:
listenerClass: external-unstable
configOverrides:
nifi.properties:
nifi.nar.library.directory.myCustomLibs: /stackable/userdata/nifi-processors/ # <2>
Expand Down Expand Up @@ -281,12 +282,13 @@ spec:
- name: nifi-processors
persistentVolumeClaim:
claimName: nifi-processors
listenerClass: external-unstable
sensitiveProperties:
keySecret: nifi-sensitive-property-key
autoGenerate: true
zookeeperConfigMapName: simple-nifi-znode
nodes:
roleConfig:
listenerClass: external-unstable
configOverrides:
nifi.properties:
nifi.nar.library.directory.myCustomLibs: /stackable/userdata/nifi-processors/ # <2>
Expand Down
3 changes: 2 additions & 1 deletion docs/modules/nifi/pages/usage_guide/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ spec:
- name: nifi-client-certs
secret:
secretName: nifi-client-certs
listenerClass: external-unstable
sensitiveProperties:
keySecret: nifi-sensitive-property-key
autoGenerate: true
nodes:
roleConfig:
listenerClass: external-unstable
roleGroups:
default:
config:
Expand Down
17 changes: 6 additions & 11 deletions docs/modules/nifi/pages/usage_guide/listenerclass.adoc
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
= Service exposition with ListenerClasses
:description: Configure Apache NiFi service exposure with cluster-internal or external-unstable listener classes.

Apache NiFi offers a web UI and an API.
The Operator deploys a service called `<name>` (where `<name>` is the name of the NifiCluster) through which NiFi can be reached.

This service can have either the `cluster-internal` or `external-unstable` type.
`external-stable` is not supported for NiFi at the moment.
Read more about the types in the xref:concepts:service-exposition.adoc[service exposition] documentation at platform level.

This is how the listener class is configured:
The operator deploys a xref:listener-operator:listener.adoc[Listener] for the Node pod.
The listener defaults to only being accessible from within the Kubernetes cluster, but this can be changed by setting `.spec.nodes.roleConfig.listenerClass`:

[source,yaml]
----
spec:
clusterConfig:
listenerClass: cluster-internal # <1>
nodes:
roleConfig:
listenerClass: external-unstable # <1>
----
<1> The default `cluster-internal` setting.
<1> Specify one of `external-stable`, `external-unstable`, `cluster-internal` or a custom ListenerClass (the default setting is `cluster-internal`).
4 changes: 2 additions & 2 deletions docs/modules/nifi/pages/usage_guide/monitoring.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ spec:
- __meta_kubernetes_pod_container_port_number
targetLabel: __address__
replacement: ${1}.${2}.${3}.svc.cluster.local:${4}
regex: (.+);(.+?)(?:-metrics)?;(.+);(.+)
regex: (.+);(.+?)(?:-headless)?;(.+);(.+)
selector:
matchLabels:
prometheus.io/scrape: "true"
Expand All @@ -138,4 +138,4 @@ spec:
<1> Authorization via Bearer Token stored in a secret
<2> Relabel \\__address__ to be a FQDN rather then the IP-Address of target pod

NOTE: As of xref:listener-operator:listener.adoc[Listener] integration, SDP exposes a Service with `-metrics` thus we need to regex this suffix.
NOTE: As of xref:listener-operator:listener.adoc[Listener] integration, SDP exposes a Service with `-headless` thus we need to regex this suffix.
4 changes: 2 additions & 2 deletions examples/simple-nifi-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ spec:
clusterConfig:
authentication:
- authenticationClass: simple-nifi-admin-user
listenerClass: external-unstable
sensitiveProperties:
keySecret: nifi-sensitive-property-key
autoGenerate: true
zookeeperConfigMapName: simple-nifi-znode
nodes:
config:
roleConfig:
listenerClass: external-unstable
roleGroups:
default:
replicas: 1
6 changes: 3 additions & 3 deletions rust/operator-binary/src/config/jvm.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use snafu::{OptionExt, ResultExt, Snafu};
use stackable_operator::{
memory::{BinaryMultiple, MemoryQuantity},
role_utils::{self, GenericRoleConfig, JavaCommonConfig, JvmArgumentOverrides, Role},
role_utils::{self, JavaCommonConfig, JvmArgumentOverrides, Role},
};

use crate::{
config::{JVM_SECURITY_PROPERTIES_FILE, NIFI_CONFIG_DIRECTORY},
crd::{NifiConfig, NifiConfigFragment},
crd::{NifiConfig, NifiConfigFragment, NifiNodeRoleConfig},
};

// Part of memory resources allocated for Java heap
Expand All @@ -29,7 +29,7 @@ pub enum Error {
/// Create the NiFi bootstrap.conf
pub fn build_merged_jvm_config(
merged_config: &NifiConfig,
role: &Role<NifiConfigFragment, GenericRoleConfig, JavaCommonConfig>,
role: &Role<NifiConfigFragment, NifiNodeRoleConfig, JavaCommonConfig>,
role_group: &str,
) -> Result<JvmArgumentOverrides, Error> {
let heap_size = MemoryQuantity::try_from(
Expand Down
11 changes: 6 additions & 5 deletions rust/operator-binary/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ use stackable_operator::{
ValidatedRoleConfigByPropertyKind, transform_all_roles_to_config,
validate_all_roles_and_groups_config,
},
role_utils::{GenericRoleConfig, JavaCommonConfig, Role},
role_utils::{JavaCommonConfig, Role},
};
use strum::{Display, EnumIter};

use crate::{
crd::{
HTTPS_PORT, NifiConfig, NifiConfigFragment, NifiRole, NifiStorageConfig, PROTOCOL_PORT,
sensitive_properties, v1alpha1, v1alpha1::NifiClusteringBackend,
HTTPS_PORT, NifiConfig, NifiConfigFragment, NifiNodeRoleConfig, NifiRole,
NifiStorageConfig, PROTOCOL_PORT, sensitive_properties,
v1alpha1::{self, NifiClusteringBackend},
},
operations::graceful_shutdown::graceful_shutdown_config_properties,
security::{
Expand Down Expand Up @@ -112,7 +113,7 @@ pub enum Error {
pub fn build_bootstrap_conf(
merged_config: &NifiConfig,
overrides: BTreeMap<String, String>,
role: &Role<NifiConfigFragment, GenericRoleConfig, JavaCommonConfig>,
role: &Role<NifiConfigFragment, NifiNodeRoleConfig, JavaCommonConfig>,
role_group: &str,
) -> Result<String, Error> {
let mut bootstrap = BTreeMap::new();
Expand Down Expand Up @@ -736,7 +737,7 @@ pub fn build_state_management_xml(clustering_backend: &NifiClusteringBackend) ->
pub fn validated_product_config(
resource: &v1alpha1::NifiCluster,
version: &str,
role: &Role<NifiConfigFragment, GenericRoleConfig, JavaCommonConfig>,
role: &Role<NifiConfigFragment, NifiNodeRoleConfig, JavaCommonConfig>,
product_config: &ProductConfigManager,
) -> Result<ValidatedRoleConfigByPropertyKind, Error> {
let mut roles = HashMap::new();
Expand Down
Loading