Provisioning NiFi Dataflows
You can create NiFi dataflows either :
- directly against the cluster through its REST API (using UI or some home made scripts), or
- via the
NifiDataflow
CRD.
If you want more details about the design, just have a look on the design page
To deploy a NifiDataflow you have to start by deploying a NifiRegistryClient because NiFiKop manages dataflow using the NiFi Registry feature.
Below is an example of NifiRegistryClient :
Once you have deployed your NifiRegistryClient, you have the possibility of defining a configuration that you will apply to your NifiDataflow.
This configuration is defined using the NifiParameterContext CRD, which NiFiKop will convert into a Parameter context.
Below is an example of NifiParameterContext :
As you can see, in the NifiParameterContext you can refer to some secrets that will be converted into sensitive parameter.
Here is an example of secret that you can create that will be used by the configuration above :
warning
As a sensitive value cannot be retrieved through the Rest API, to update the value of a sensitive parameter, you have to :
- remove it from the secret
- wait for the next loop
- insert the parameter with the new value inside the secret
or you can simply create a new NifiParameterContext and refer it into your NifiDataflow.
You can now deploy your NifiDataflow by referencing the previous objects :
To find details about the versioned flow information required check the official documentation
You have two modes of control from your dataflow by the operator :
1 - Spec.RunOnce == true
: The operator will deploy the dataflow as described in the resource, run it once, and never control it again (unless you change the field to false
). It is useful when you want to deploy your dataflow in a dev environment, and you want to update the dataflow.
2 - Spec.RunOnce == false
: The operator will deploy and ensure the dataflow lifecycle, it will avoid all manual modification directly from the Cluster (e.g remove the process group, remove the versioning, update the parent process group, make some local changes ...). If you want to perform update, rollback or stuff like this, you have to simply update the NifiDataflow resource.
important
More information about Spec.UpdateStrategy
here