Skip to content

Support for running with Kubernetes as quorum manager instead of ZooKeeper #737

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

Closed
1 of 3 tasks
soenkeliebau opened this issue Jan 13, 2025 · 6 comments · Fixed by #775
Closed
1 of 3 tasks

Support for running with Kubernetes as quorum manager instead of ZooKeeper #737

soenkeliebau opened this issue Jan 13, 2025 · 6 comments · Fixed by #775
Assignees
Labels
release/25.7.0 release-note Denotes a PR that will be considered when it comes time to generate release notes.

Comments

@soenkeliebau
Copy link
Member

soenkeliebau commented Jan 13, 2025

NiFi now supports running with Kubernetes as quorum manager instead of ZooKeeper. We should implement this and offer it as an option.

In principle this is just a few settings that could be overriden, but an entry needs to be written in an xml file, which we currently hard-code and effectively kill these overrides.

@nightkr
Copy link
Member

nightkr commented Mar 21, 2025

Looks like this has two components:

  1. Clustering coordination (https://nifi.apache.org/nifi-docs/administration-guide.html#kubernetes-clustering)

This just requires us to set nifi.cluster.leader.election.implementation, and give NiFi permission to manage Lease objects:

---
apiVersion: nifi.stackable.tech/v1alpha1
kind: NifiCluster
metadata:
  name: simple-nifi
spec:
  # [snip]
  nodes:
    configOverrides:
      nifi.properties:
        nifi.cluster.leader.election.implementation: KubernetesLeaderElectionManager
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: nifi-extra
rules:
  # https://nifi.apache.org/nifi-docs/administration-guide.html#kubernetes-clustering
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    verbs:
      - create
      - get
      - update
      # undocumented but required
      - patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: nifi-extra
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: nifi-extra
subjects:
  - kind: ServiceAccount
    name: simple-nifi-serviceaccount

(Though obviously we should provide proper support, this is just illustrative of the scope of change we'd need to make.)

  1. Cluster state storage (https://nifi.apache.org/nifi-docs/administration-guide.html#kubernetes-configmap-cluster-state-provider)

This is configured by the XML file Sönke refers to in the OP. In theory the change scope should be similarly small, but this is indeed hard-coded and would require an operator change.

@lfrancke lfrancke moved this from Proposed to In Progress in Stackable End-to-End Coordination Mar 26, 2025
@nightkr nightkr moved this from Refinement: In Progress to Development: Waiting for Review in Stackable Engineering May 9, 2025
@sbernauer
Copy link
Member

@soenkeliebau will have a look and try it out. @maltesander is up to also helping out

@sbernauer sbernauer moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering May 26, 2025
@nightkr
Copy link
Member

nightkr commented May 27, 2025

Release note:

The Stackable Operator for NiFi now supports using Kubernetes for cluster coordination and storage, rather than ZooKeeper. (Requires NiFi 2.x, migrating existing installs is currently not supported.)

Docs: https://github.com/stackabletech/nifi-operator/blob/c6e3b2831a650153d5d3f293fb9e3b9f65439557/docs/modules/nifi/pages/usage_guide/clustering.adoc#backend-kubernetes (also reorganized the page to focus on clustering in general rather than ZooKeeper in specific.)

@maltesander maltesander moved this from Development: In Review to Development: Done in Stackable Engineering May 27, 2025
@maltesander maltesander moved this from In Progress to Done in Stackable End-to-End Coordination May 27, 2025
@sbernauer
Copy link
Member

@nightkr in case you didn't already I think this is a good opportunity to update the demos to use the new feature

@nightkr
Copy link
Member

nightkr commented May 27, 2025

@sbernauer Depends, I was thinking about at least the getting started but that still ships 1.x for now.

@sbernauer
Copy link
Member

Created stackabletech/demos#221 for that. The demos are already on 2.4.0, IMHO this is the perfect opportunity to test the feature

@lfrancke lfrancke moved this from Development: Done to Acceptance: In Progress in Stackable Engineering May 28, 2025
@lfrancke lfrancke added release/25.7.0 release-note Denotes a PR that will be considered when it comes time to generate release notes. labels May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/25.7.0 release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
Status: Acceptance: In Progress
Development

Successfully merging a pull request may close this issue.

4 participants