Configuring assets
Learn about configuring access to NiFi assets.
You can make NiFi assets, such as custom processor JARs, or configuration files available to
your NiFi cluster using the assets field. This field allows you to
specify a mount path within the NiFi Pods to which the provided pre-existing Persistent Volume
Claim (PVC) is mounted. Cloudera Flow Management - Kubernetes Operator does not provide a method of
loading assets into this volume. Using the example below, all files located in the volume
associated with my-nifi-assets-volume-claim
are accessible at the path
/opt/nifi/nifi-assets/
for use within your flow.
Before you can start using assets with NiFi deployed through Cloudera Flow Management - Kubernetes Operator, you have to provide the following:
- A volume provisioner which supports creating volumes that are ReadWriteMany (RWX), for example nfs-provisioner.
- A pod running some kind of software or process (for example, an FTP server) attached to the RWX volume for loading files onto the volume. Alternatively, you can use the kubectl cp command to directly copy files into most containers, such as Ubuntu.
After meeting the above prerequisites, you need to create a Persistent Volume Claim (PVC) which creates the required RWX volume. For example:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nifi-assets
spec:
storageClassName: [***STORAGE CLASS***]
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
where [***STORAGE CLASS***] refers to the Storage Class associated with the RWX volume provisioner.
With the PVC created and the PV provisioned, attach the pod you have created, expose the pod via Ingress or Service if required, and load the asset files.
spec:
assets:
mountPath: [***ASSETS PATH***]
persistentVolumeClaim:
name: nifi-assets
where [***ASSETS PATH***] is the filesystem path within the NiFi container where the assets are located, for example, /opt/nifi/assets.