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(whereX,Y, andZare 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-22.6.0my-build-nifi_1.28.0-rc11.28.0latestNiFi 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
Nifispec: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.0or2.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:
spec.nifiVersion- if set, this value is always used- Image tag - if
spec.nifiVersionis 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.nifiVersionis set and the image tag contains anifi_X.Y.Zsegment, 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.nifiVersionis absent and the image tag does not contain anifi_X.Y.Zsegment, 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.nifiVersionexplicitly when using images whose tags do not follow thenifi_X.Y.Zpattern. - The
nifi_X.Y.Zsegment is embedded in all Cloudera-produced image tags, addingspec.nifiVersionis 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.nifiVersionin sync with the actual NiFi version in the image, or omit it and rely on image tag detection.
