Configuring the NiFi image

Specify location of the image used for deployment.

This is how you specify the NiFi image repository, image version, and NiFi version to be used for deployment. This describes the images used for running NiFi. This also provides a way of manually upgrading the NiFi version in an existing cluster or very quickly rolling out NiFi clusters with new versions.

spec:
  nifiVersion: [***NIFI VERSION***]
  image:
    repository: container.repository.cloudera.com/cloudera/cfm-nifi-k8s
    tag: [***IMAGE VERSION TAG***]
  

Specifying the NiFi version

Automatic detection from the image tag

When the image tag contains a segment matching the pattern nifi_X.Y.Z (where X, Y, and Z are integers), the operator extracts the NiFi version from it automatically. This is the format used by Cloudera-produced images:

apiVersion: cfm.cloudera.com/v1alpha1
kind: Nifi
metadata:
  name: my-nifi
spec:
  image:
    tag: "3.1.0-b107-nifi_2.6.0.4.12.0.1-2"
Image tag Detected NiFi version
3.1.0-b107-nifi_2.6.0.4.12.0.1-2 2.6.0
my-build-nifi_1.28.0-rc1 1.28.0
latest NiFi version cannot be detected.
spec.nifiVersion field

If, for some reason, it is not viable to use an image tag compatible with the automatic detection, you can provide a version in the Nifi spec:

apiVersion: cfm.cloudera.com/v1alpha1
kind: Nifi
metadata:
  name: my-nifi
spec:
  nifiVersion: "2.6.0"
image:
    tag: "latest"

The value must be a valid SemVer string (for example, 1.28.0 or 2.6.0). Only NiFi major versions 1 and 2 are supported.

Version resolution

When Cloudera Flow Management Operator for Kubernetes needs the NiFi version, it uses the following order of precedence:

  1. spec.nifiVersion - if set, this value is always used
  2. Image tag - if spec.nifiVersion is absent, the version is parsed from the image tag

If neither source provides a version, the CR is rejected to protect from misconfiguration.

Validation and warnings

Mismatch warning

If both spec.nifiVersion is set and the image tag contains a nifi_X.Y.Z segment, the operator compares them. When they differ, a warning is returned on create or update actions:

Detected NiFi version '2.6.0' from image tag does not match the specified NiFi version '1.0.0'
in the CR. Please ensure that the image tag correctly reflects the NiFi version or update the
spec.niFiVersion field to match the detected version.

The warning does not block the operation, but it indicates a likely misconfiguration. Check that the image being used actually contains the NiFi version specified in spec.nifiVersion.

No detectable version (error)

If spec.nifiVersion is absent and the image tag does not contain a nifi_X.Y.Z segment, the CR is rejected with a similar error message:

NiFi version cannot be determined from either the spec.nifiVersion field or the image tag.
Please specify a valid NiFi version in the spec.nifiVersion field or use an image with a tag
that includes the NiFi version.

This situation does not arise with Cloudera-produced images.

Best Practices

  • For custom images, always set spec.nifiVersion explicitly when using images whose tags do not follow the nifi_X.Y.Z pattern.
  • The nifi_X.Y.Z segment is embedded in all Cloudera-produced image tags, adding spec.nifiVersion is optional. Set it explicitly if you want to be unambiguous or if you want to guard against accidental image tag changes.
  • To avoid the mismatch warning, keep spec.nifiVersion in sync with the actual NiFi version in the image, or omit it and rely on image tag detection.