Skip to content

chore!: Remove NiFi 1.x configuration CRD fields #954

Open
sbernauer wants to merge 3 commits into
mainfrom
chore/remove-nifi-1-support
Open

chore!: Remove NiFi 1.x configuration CRD fields #954
sbernauer wants to merge 3 commits into
mainfrom
chore/remove-nifi-1-support

Conversation

@sbernauer

@sbernauer sbernauer commented Jul 1, 2026

Copy link
Copy Markdown
Member

Description

Part of stackabletech/docker-images#1498

#944 dropped 1.28.1 from the list of supported version, but we also need to remove all the NiFi 1.x code. This PR does this. Pls note that this removes CRD fields, thus is breaking.
This removes the Prometheus reporting-task Job (and its spec.clusterConfig.createReportingTaskJob field), the pre-2.x non-rolling upgrade handling, the dedicated metrics port, and the sensitive-properties algorithms that were only supported on NiFi 1.x.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

Release notes

Removed

Dropped support for NiFi 1.x alongside with a few CRD fields that only applied to 1.x and had no effect on NiFi 2.x:

  • spec.clusterConfig.createReportingTaskJob (incl. enabled, podOverrides) — NiFi 2.x exposes Prometheus metrics directly at /nifi-api/flow/metrics/prometheus, so the reporting-task Job is obsolete.
  • Removed deprecated spec.clusterConfig.sensitiveProperties.algorithm values, please use an supported algorithm instead: nifiArgon2AesGcm256 (default) and nifiPbkdf2AesGcm256

@sbernauer sbernauer self-assigned this Jul 1, 2026
@sbernauer sbernauer moved this to Development: In Progress in Stackable Engineering Jul 1, 2026
@sbernauer sbernauer changed the title chore!: Remove NiFi 1.x configuration fields chore!: Remove NiFi 1.x configuration CRD fields Jul 1, 2026
@sbernauer sbernauer moved this from Development: In Progress to Development: Waiting for Review in Stackable Engineering Jul 1, 2026
@sbernauer

Copy link
Copy Markdown
Member Author

@sbernauer sbernauer moved this to Development: Waiting for Review in Stackable Engineering Jul 1, 2026
Comment thread docs/modules/nifi/pages/usage_guide/monitoring.adoc Outdated
Comment thread extra/crds.yaml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is ok to just remove. I can't think of another way, and the config is no longer supported, so I guess it is fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I was also thinking of using CRD versioning, but IIRC we only support renames so far

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could deprecate it, but are we then keeping it forever? We will discuss in the team with @Techassi as well

NickLarsenNZ
NickLarsenNZ previously approved these changes Jul 1, 2026

@NickLarsenNZ NickLarsenNZ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NickLarsenNZ NickLarsenNZ moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Jul 1, 2026
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
@sbernauer

Copy link
Copy Markdown
Member Author

Just dumping a spike for v1alpha2 with a deprecation

diff
diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs
index 8ce0d8c..3a89c5e 100644
--- a/rust/operator-binary/src/crd/mod.rs
+++ b/rust/operator-binary/src/crd/mod.rs
@@ -27,7 +27,10 @@ use stackable_operator::{
     config_overrides::{KeyValueConfigOverrides, KeyValueOverridesProvider},
     crd::{authentication::core as auth_core, git_sync},
     deep_merger::ObjectOverrides,
-    k8s_openapi::{api::core::v1::Volume, apimachinery::pkg::api::resource::Quantity},
+    k8s_openapi::{
+        api::core::v1::{PodTemplateSpec, Volume},
+        apimachinery::pkg::api::resource::Quantity,
+    },
     kube::{CustomResource, ResourceExt, runtime::reflector::ObjectRef},
     memory::MemoryQuantity,
     product_config_utils::{self, Configuration},
@@ -36,7 +39,7 @@ use stackable_operator::{
     schemars::{self, JsonSchema},
     shared::time::Duration,
     status::condition::{ClusterCondition, HasStatusCondition},
-    utils::crds::raw_object_list_schema,
+    utils::crds::{raw_object_list_schema, raw_object_schema},
     versioned::versioned,
 };
 use tls::NifiTls;
@@ -73,6 +76,7 @@ pub enum Error {
 
 #[versioned(
     version(name = "v1alpha1"),
+    version(name = "v1alpha2"),
     crates(
         kube_core = "stackable_operator::kube::core",
         kube_client = "stackable_operator::kube::client",
@@ -162,6 +166,11 @@ pub mod versioned {
         #[serde(default, skip_serializing_if = "Vec::is_empty")]
         #[schemars(schema_with = "raw_object_list_schema")]
         pub extra_volumes: Vec<Volume>,
+
+        // Docs are on the struct
+        #[serde(default)]
+        #[versioned(deprecated(since = "v1alpha2"))]
+        pub deprecated_create_reporting_task_job: CreateReportingTaskJob,
     }
 
     // This is flattened in for backwards compatibility reasons, `zookeeper_config_map_name` already existed and used to be mandatory.
@@ -306,6 +315,43 @@ pub fn default_allow_all() -> bool {
     true
 }
 
+/// This section creates a `create-reporting-task` Kubernetes Job, which enables the export of
+/// Prometheus metrics within NiFi.
+#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
+#[serde(rename_all = "camelCase")]
+pub struct CreateReportingTaskJob {
+    /// Whether the Kubernetes Job should be created, defaults to true. It can be helpful to disable
+    /// the Job, e.g. when you configOverride an authentication mechanism, which the Job currently
+    /// can't use to authenticate against NiFi.
+    #[serde(default = "CreateReportingTaskJob::default_enabled")]
+    pub enabled: bool,
+
+    /// Here you can define a
+    /// [PodTemplateSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podtemplatespec-v1-core)
+    /// to override any property that can be set on the Pod of the create-reporting-task Kubernetes Job.
+    /// Read the
+    /// [Pod overrides documentation](DOCS_BASE_URL_PLACEHOLDER/concepts/overrides#pod-overrides)
+    /// for more information.
+    #[serde(default)]
+    #[schemars(schema_with = "raw_object_schema")]
+    pub pod_overrides: PodTemplateSpec,
+}
+
+impl Default for CreateReportingTaskJob {
+    fn default() -> Self {
+        Self {
+            enabled: Self::default_enabled(),
+            pod_overrides: Default::default(),
+        }
+    }
+}
+
+impl CreateReportingTaskJob {
+    const fn default_enabled() -> bool {
+        true
+    }
+}
+
 #[derive(strum::Display)]
 #[strum(serialize_all = "camelCase")]
 pub enum NifiRole {
@@ -543,11 +589,14 @@ fn node_default_listener_class() -> String {
 mod tests {
     use stackable_operator::versioned::test_utils::RoundtripTestData;
 
-    use super::v1alpha1;
+    use super::{v1alpha1, v1alpha2};
 
-    impl RoundtripTestData for v1alpha1::NifiClusterSpec {
-        fn roundtrip_test_data() -> Vec<Self> {
-            stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {r#"
+    /// The v1alpha1 and v1alpha2 specs are identical apart from the reporting task job field, which
+    /// is called `createReportingTaskJob` in v1alpha1 and `deprecatedCreateReportingTaskJob` in
+    /// v1alpha2. The differing name is templated in via `{{reporting_task_job_field}}` so that the
+    /// YAML can be shared between both versions.
+    fn nifi_cluster_roundtrip_test_data(reporting_task_job_field: &str) -> String {
+        indoc::indoc! {r#"
               - image:
                   productVersion: 1.2.3
                   pullPolicy: IfNotPresent
@@ -564,6 +613,11 @@ mod tests {
                       - example.com:1234
                   sensitiveProperties:
                     keySecret: nifi-sensitive-property-key
+                  {{reporting_task_job_field}}:
+                    enabled: false
+                    podOverrides:
+                      spec:
+                        securityContext: {}
                   customComponentsGitSync:
                     - repo: ssh://git@github.com/stackable-airflow/dags.git
                     - repo: https://github.com/stackable-airflow/dags
@@ -634,8 +688,25 @@ mod tests {
                                   cpu: 700m
                                 limits:
                                   cpu: 1200m
-        "#})
-            .expect("Failed to parse NifiClusterSpec YAML")
+        "#}
+        .replace("{{reporting_task_job_field}}", reporting_task_job_field)
+    }
+
+    impl RoundtripTestData for v1alpha1::NifiClusterSpec {
+        fn roundtrip_test_data() -> Vec<Self> {
+            stackable_operator::utils::yaml_from_str_singleton_map(
+                &nifi_cluster_roundtrip_test_data("createReportingTaskJob"),
+            )
+            .expect("Failed to parse v1alpha1 NifiClusterSpec YAML")
+        }
+    }
+
+    impl RoundtripTestData for v1alpha2::NifiClusterSpec {
+        fn roundtrip_test_data() -> Vec<Self> {
+            stackable_operator::utils::yaml_from_str_singleton_map(
+                &nifi_cluster_roundtrip_test_data("deprecatedCreateReportingTaskJob"),
+            )
+            .expect("Failed to parse v1alpha2 NifiClusterSpec YAML")
         }
     }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

2 participants