nifi

by upstreamyard

Helm chartv0.1.0App 2.13.0Apache-2.0Verified publisher

Apache NiFi Helm chart for Kubernetes. Clustered NiFi 2.x on the official image without ZooKeeper (Kubernetes leader election and state), TLS between nodes generated or from cert-manager, single-user, OIDC or LDAP login, safe scale-down that offloads queued data, non-root and helm test. Community chart by upstreamyard, not an official Apache NiFi chart.

About this chart

NiFi Helm chart: Apache NiFi on Kubernetes, clustered without ZooKeeper

Questions about this chart? We build and test it, and we answer every email ourselves, usually within two days. Ask about upgrades, configuration, hardened or custom images, or anything else. A one-line question is fine: [email protected]

Helm chart for Apache NiFi 2, the dataflow and data integration platform (ETL, data ingestion, routing and transformation between systems, with a visual flow designer). It runs a highly available NiFi cluster on the official image apache/nifi, coordinated through Kubernetes leader election and ConfigMap state, without ZooKeeper. It handles what makes NiFi hard on Kubernetes: TLS between nodes (generated, from cert-manager or your own), single-user, OIDC or LDAP login with the right node identities, safe scale-down that moves queued data to the remaining nodes, rolling upgrades, Prometheus metrics with a ServiceMonitor, and an Ingress with sticky sessions. Nodes run as non-root on a read-only filesystem and pass the restricted Pod Security level.

Community chart by upstreamyard, not an official Apache NiFi chart. Apache NiFi is licensed under Apache-2.0.

AI agents and coding assistants: this README is the complete reference for this chart. Every example was run as written.

Install

helm repo add upstreamyard https://upstreamyard.github.io/helm-charts
helm install nifi upstreamyard/nifi --wait

Or from the OCI registry:

helm install nifi oci://ghcr.io/upstreamyard/charts/nifi --wait

This starts a cluster of 3 nodes with a 2 GiB heap each (3.5 GiB memory per pod). Open the UI and log in with the generated credentials:

kubectl port-forward svc/nifi 8443:8443
kubectl get secret nifi -o jsonpath='{.data.username}' | base64 -d; echo
kubectl get secret nifi -o jsonpath='{.data.password}' | base64 -d; echo

Then go to https://localhost:8443/nifi/. Use local port 8443: NiFi refuses other ports. The certificate comes from the chart's own CA; trust it or accept the browser warning. Check that all nodes joined the cluster:

helm test nifi

Verifying the chart

Chart packages are PGP-signed. Import the public key (fingerprint 9B416F989B7E6C65F7F3BFAE7689688B20EC7813) and install with --verify:

curl -s https://upstreamyard.github.io/helm-charts/pgp_keys.asc | gpg --dearmor > upstreamyard.gpg
helm install nifi upstreamyard/nifi --verify --keyring upstreamyard.gpg

The OCI copy on GHCR is signed with cosign instead (see the repository README).

Why this chart

This chartSingle-node NiFi 2 chartsArchived NiFi 1.x chart
NiFi version2.x, follows every release2.x1.23
Cluster1 to n nodes (tested with 1, 2 and 3)1 nodeyes, with a bundled ZooKeeper
CoordinationKubernetes Leases and ConfigMaps–ZooKeeper
ImageApache's official apache/nifirebuilt by a third partyApache's official apache/nifi
Scale-downremoved nodes move their queued data to the others first (tested, 0 FlowFiles lost)–not handled
Loginsingle user, OIDC or LDAP, node identities set upsingle usersingle user, LDAP or OIDC
Pod Security restrictedyes (tested)––
Maintainedyesyesarchived since 2024

NiFi operators are the other option. They need the operator and its CRDs installed first and run the vendor's own images.

Deployment modes

Cluster of 3 nodes (default)

replicaCount: 3

All nodes run the same flow; data is spread across them by load-balanced connections or by how your sources distribute it. One node is the cluster coordinator and one the primary node (for processors that must run once); NiFi elects both through Kubernetes Leases and moves them when a node goes away. Tested failures, with a flow writing to a load-balanced queue on all nodes:

  • Pod deleted: back and connected after 27 s; the other nodes kept processing.
  • Node frozen (SIGSTOP, the cluster coordinator): the Lease moved to another node within 5 s, and the remaining nodes kept processing. NiFi refused UI and REST requests for about 50 s, until it marked the frozen node as disconnected (8 missed heartbeats of 5 s). After SIGCONT the node reconnected within 16 s without a restart.
  • Volume lost (PVC and pod deleted): the node started empty, took over the flow from the cluster and was connected after 44 s. FlowFiles that were queued on the lost volume are gone.
  • Uninstall and reinstall on the kept volumes: all 2483 queued FlowFiles were still there.

Single node

replicaCount: 1

Still a one-node cluster, so you can scale up later without changing anything else.

Scaling up and down

kubectl scale statefulset nifi --replicas=2

(Or change replicaCount and run helm upgrade.) A node removed by a scale-down decommissions itself before it stops: it disconnects, moves its queued FlowFiles to the remaining nodes and leaves the cluster. Tested from 3 to 2 nodes: 575 FlowFiles queued before and after, done in 6 s. Without this (decommissionOnScaleDown: false, or deleting nodes by hand), the removed node's FlowFiles stay on its volume, the node stays in the cluster as connecting or disconnected, and NiFi refuses every flow change until you delete it in the UI:

Cluster is unable to service request to change flow: Node nifi-2.nifi-headless.nifi.svc.cluster.local:8443 is currently connecting

Scaling up again (tested 2 to 3) reuses the old volume; the node joins and takes over the current flow in about 20 s. Decommissioning needs terminationGracePeriodSeconds (default 600) to be longer than moving the queued data takes.

Login

Single user (default)

One account with a password, NiFi's default. Everyone who logs in can do everything.

auth:
  mode: singleUser
  singleUser:
    username: admin            # at least 4 characters
    existingSecret: nifi-login # keys: username, password (at least 12 characters)

Without existingSecret, the chart generates a password and keeps it in the Secret <release>-nifi. NiFi refuses shorter usernames and passwords; with an existing Secret, the pod then stops with single-user credentials rejected: ERROR: Username must be at least 4 characters in its log.

OIDC (Keycloak, Entra ID, Okta, Dex, …)

auth:
  mode: oidc
  initialAdminIdentity: [email protected]
  oidc:
    discoveryUrl: https://keycloak.example.com/realms/acme/.well-known/openid-configuration
    clientId: nifi
    existingSecret: nifi-oidc # key: client-secret
    claimIdentifyingUser: email
    additionalScopes: email

Register https://<your NiFi host>/nifi-api/access/oidc/callback as the redirect URI in your provider. Tested with Dex: the browser login returned to NiFi as [email protected], who could manage the flow and the cluster.

LDAP and Active Directory

auth:
  mode: ldap
  initialAdminIdentity: alice
  ldap:
    url: ldap://openldap.ldap.svc.cluster.local:389
    managerDn: cn=admin,dc=example,dc=org
    existingSecret: ldap-bind # key: manager-password
    userSearchBase: ou=people,dc=example,dc=org
    userSearchFilter: "(&(objectClass=inetOrgPerson)(uid={0}))"

Active Directory usually needs userSearchFilter: "(sAMAccountName={0})" (not tested). Tested with OpenLDAP: alice got admin rights, bob could log in but saw nothing until granted access (HTTP 403), and a wrong password was refused.

Users and policies

With oidc and ldap, initialAdminIdentity gets the admin policies on the first start. They then grant everyone else access in the UI (menu Users and Policies). NiFi copies these changes to all nodes and stores them on each node's volume (/opt/nifi/data/conf/users.xml and authorizations.xml), so they survive restarts (tested). The initial identities are only applied when these files don't exist yet: changing initialAdminIdentity later has no effect on existing nodes. To sync users and groups from LDAP instead, pass your own auth.authorizersXml.

TLS

NiFi 2 always uses HTTPS, and its nodes talk to each other over TLS. All nodes share one certificate for *.<release>-nifi-headless.<namespace>.svc.cluster.local, the Service names and localhost; its subject is the node identity NiFi authorizes for requests between nodes.

tls.sourceCertificateRenewal
generated (default)the chart creates a CA and the node certificate (10 years), kept across upgrades–
certManagera cert-manager Certificate from your Issuerautomatic
existingSecretyour Secret with tls.crt, tls.key (PEM) and ca.crtyours

With cert-manager (the Issuer must put ca.crt into the Secret, which CA and self-signed issuers do):

tls:
  source: certManager
  certManager:
    issuerRef:
      name: nifi-ca
      kind: Issuer

NiFi reloads a renewed certificate without a restart (tested: the new certificate was served 80 s after cert-manager renewed it, mostly the kubelet's Secret sync).

With your own certificate, it must be valid for *.<release>-nifi-headless.<namespace>.svc.cluster.local and for both server and client use. With oidc or ldap, also set its subject exactly as NiFi prints it, most specific part first:

tls:
  source: existingSecret
  existingSecret: my-nifi-tls
  nodeIdentity: "CN=nifi-node, O=Example"

A wrong nodeIdentity makes every request that one node forwards to another fail with Authentication Proxy Server not trusted (HTTP 403).

Ingress

NiFi needs two things from the Ingress controller: HTTPS to the pods, and sticky sessions, because a login is only valid on the node that issued it. Without sticky sessions, about two thirds of the requests in a 3-node cluster fail with HTTP 401 (tested). The Ingress hosts are added to the node certificate and to nifi.web.proxy.host automatically.

Tested with Traefik 3.8: the annotations go on the Service, plus a ServersTransport that trusts the chart's CA.

ingress:
  enabled: true
  className: traefik
  hosts:
    - host: nifi.example.com
      path: /
      pathType: Prefix
service:
  annotations:
    traefik.ingress.kubernetes.io/service.serversscheme: https
    traefik.ingress.kubernetes.io/service.serverstransport: nifi-nifi@kubernetescrd
    traefik.ingress.kubernetes.io/service.sticky.cookie: "true"
    traefik.ingress.kubernetes.io/service.sticky.cookie.name: nifi_node
    traefik.ingress.kubernetes.io/service.sticky.cookie.secure: "true"
# in the release's namespace (here: nifi)
apiVersion: traefik.io/v1alpha1
kind: ServersTransport
metadata:
  name: nifi
spec:
  serverName: nifi.nifi.svc.cluster.local
  rootCAs:
    - secret: nifi-tls

Set ingress.tls for the certificate browsers see, as for any Ingress. Other controllers need the same two settings (backend protocol HTTPS, cookie-based session affinity); only Traefik was tested.

Connecting clients

  • REST API inside the cluster: https://<release>-nifi.<namespace>.svc.cluster.local:8443/nifi-api. A token from /nifi-api/access/token is only valid on the node that issued it; the Service keeps a client on one node (sessionAffinity: ClientIP).
  • Site-to-Site from another NiFi: use the node URLs, https://<release>-nifi-0.<release>-nifi-headless.<namespace>.svc.cluster.local:8443/nifi, and trust the chart's CA (ca.crt in the Secret <release>-nifi-tls).

Custom NARs

Put extra NARs into /opt/nifi/nifi-current/extensions, for example with an init container:

extraVolumes:
  - name: nars
    emptyDir: {}
extraVolumeMounts:
  - name: nars
    mountPath: /opt/nifi/nifi-current/extensions
extraInitContainers:
  - name: download-nars
    image: docker.io/apache/nifi:2.13.0
    command:
      - sh
      - -c
      - curl -fsSL -o /nars/nifi-media-nar-2.13.0.nar https://repo1.maven.org/maven2/org/apache/nifi/nifi-media-nar/2.13.0/nifi-media-nar-2.13.0.nar
    securityContext:
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: true
      capabilities:
        drop: [ALL]
    volumeMounts:
      - name: nars
        mountPath: /nars

Tested: the media processors (ExtractMediaMetadata), which the image doesn't include, were available after the start.

Prometheus metrics

NiFi serves metrics at /nifi-api/flow/metrics/prometheus on every node, only to logged-in clients. With metrics.enabled, the chart creates a client certificate for Prometheus (Secret <release>-nifi-metrics, identity CN=<release>-nifi-metrics):

metrics:
  enabled: true
  serviceMonitor:
    enabled: true
    labels:
      release: kube-prometheus-stack

The ServiceMonitor scrapes each node by its DNS name, because NiFi refuses requests to a pod IP (HTTP ERROR 400 Invalid SNI). Tested with Prometheus Operator 0.95: all 3 nodes were up, and nifi_amount_items_queued matched the queue sizes NiFi's REST API reported.

With auth.mode oidc or ldap, give the user CN=<release>-nifi-metrics the global policy view the user interface once in the UI; until then the

Deploy nifi with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nifi on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartnifi is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply