Apache NiFi supports powerful and scalable directed graphs of data routing, transformation, and system mediation logic. Ref: https://nifi.apache.org/
This repo provides tools and instructions for deploying and using Apache Nifi on OpenShift, with the following characteristics:
Several components are deployed to cover as many use cases as possible:
When deployed, a secured Route is automatically created, with reencryption using the certificate emitted by NiFi-CA. Put otherwise, it's a no touch setup, everything is taken care of.
There are tons of parameters that you can play with in Apache NiFi. Therefore, instead of providing an Helm chart and trying to expose and maintain all those parameters to cover every specific use cases, I chose to use Kustomize definitions and provide different base deployments for different authentication mechanisms and cluster sizes. Those "base examples" are then easy to modify for your own needs.
Here are the steps to follow (from the base folder deployment
):
nifi
in the configuration files).nifi
, edit the file base/kustomization.yaml
and replace the namespace
variable to match this name.base/params.env.example
to base/params.env
and fill in the information (description for each variable below).base
folder or to the overlay you want to use.kustomize build -o /path/to/output/folder
oc apply -f .
to deploy Nifi!NOTE: with a recent version of OpenShift (=>4.8), you can also do directly oc apply -k .
instead of the build + apply
The base configuration deploys a NiFi cluster with a SingleUser authentication mechanism, and 3 nodes. You can modify the following parameters in params.env
:
storage_class
: storage class to use for the Persistent Volumes that are created.admin_identity
: username for the SingleUser authentication.admin_password
: password (12 characters minimum, otherwise the deployment will fail!) for the SingleUser authentication.certificate_store_password
: the password used for the KeyStore and TrustStore (needed to create SSL contexts for components like listenHTTP)uid
: a uid that will be used by the root schema and base flow of the installation (you can easily generate one on https://www.uuidgenerator.net/version4).NOTE: don't modify the nodes_number directly in the params.env
file! Use one of the overlays to modify the number of nodes (yeah, I know, that's a limitation of kustomize).
Different overlays are available, named replicas-1
to replicas-5
. They allow you to deploy the NiFi cluster with more or less nodes than the default 3.
To enable OIDC authentication, you can use the overlay oidc
.
Supplemental parameters to change in params.env
:
oidc_discovery_url
: Full address for the .well-known/openid-configuration
standard discovery file. In case of using a provider running inside the cluster (e.g. a deployment of Keycloak), it has to be the full external secured Route).oidc_client_id
: Client ID from the OIDC configuration.oidc_client_secret
: Client Secret from the OIDC configurationoidc_claim_identifying_user
: the claim in the returned Token that will be used to identify users (like email
). Specific to your OIDC provider.Full reference: https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#openid_connect
To enable LDAP authentication, you can use the overlay ldap
.
Supplemental parameters to change in params.env
:
ldap_host
: Full address to the LDAP host, with portldap_admin
: BindDN account to use to connectldap_pass
: BindDN account passwordldap_searchBase
: LDAP Search base for user accountsldap_searchFilter
: Filter users, based on groups for exampleldap_userIdentityAttribute
: Attribute identifying the user in its fully distinguished name.ldap_userIdentityMapping
: Allows to keep only the username (or parts of it) to create the account in NiFi.Full reference: https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#ldap_login_identity_provider
The ListenHTTP component (like others) can open an http(s) port where you can send information directly into a workflow. To enable this functionality, you can apply the following recipe.
ports:
- name: metrics
containerPort: 9092
protocol: TCP
- name: https
containerPort: 9443
protocol: TCP
- name: cluster
containerPort: 6007
protocol: TCP
- name: httplistener
containerPort: 8888
protocol: TCP
kind: Service
apiVersion: v1
metadata:
name: nifi-httplistener
namespace: nifi
spec:
ports:
- name: httplistener
protocol: TCP
port: 8888
targetPort: 8888
selector:
app: nifi
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: nifi-httplistener
namespace: nifi
spec:
to:
kind: Service
name: nifi-httplistener
port:
targetPort: httplistener
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
wildcardPolicy: None
The following properties are used. All the stores have the same password, set at deployment, to allow the configuration of the service, which is unique in the cluster, to work on all nodes.
/opt/nifi/nifi-current/config-data/certs/keystore.jks
certificate_store_password
parameter you set in the params.env
file for deployment.certificate_store_password
parameter you set in the params.env
file for deployment.JKS
/opt/nifi/nifi-current/config-data/certs/truststore.jks
certificate_store_password
parameter you set in the params.env
file for deployment.JKS
TLS