After going through the getting_started/installation.adoc section and having installed all the operators, you will now deploy a NiFi cluster and the required dependencies. Afterwards you can verify that it works by querying the REST API.
Two things need to be installed to create a NiFi cluster:
-
A ZooKeeper cluster for internal use by NiFi
-
The NiFi cluster itself
We will create them in this order, each one is created by applying a manifest file. The operators you just installed will then create the resources according to the manifest.
To create a ZooKeeper instance run the following command:
link:example$getting_started/getting_started.sh[role=include]
Create a Znode object:
link:example$getting_started/getting_started.sh[role=include]
The ZNode makes sure that the NiFi cluster will operate in its own separated directory in ZooKeeper.
First, make sure all pods are ready:
link:example$getting_started/getting_started.sh[role=include]
Then make sure the StatefulSets are ready:
kubectl get statefulset
The output should show all pods ready:
NAME READY AGE
simple-nifi-node-default 2/2 5m
simple-zk-server-default 3/3 7m
Congratulations! You successfully created your first NiFi cluster!
You can retrieve the URL for the NiFi cluster web interface via stackablectl
or kubectl
.
Use the service command of stackablectl
to get a list of all available endpoints:
stackablectl svc list
which should return something like this:
PRODUCT NAME NAMESPACE ENDPOINTS EXTRA INFOS nifi simple-nifi default https https://172.18.0.3:32595 zookeeper simple-zk default zk 172.18.0.3:30173
You can also use the json
output and parse the endpoint:
link:example$getting_started/getting_started.sh[role=include]
Then connect to https://172.18.0.3:32595/nifi
and you should see the NiFi web login. After providing the username admin
and password admin
you are redirected to the NiFi web interface.
Extracting the IP and port via kubectl
is cumbersome. We recommend using stackablectl
instead. The following kubectl
commands store their output for further use in a variable and write its content to stdout afterwards. Make sure to run these commands in the same terminal:
link:example$getting_started/getting_started.sh[role=include]
which should output a single node name where a NiFi pod is scheduled:
NodeName: kind-worker
Retrieve the IP of that node:
link:example$getting_started/getting_started.sh[role=include]
which should output the internal IP of that node:
NodeIp: 172.18.0.3
You might need to replace InternalIP
with ExternalIP
depending on how you connect to your Kubernetes cluster.
Finally, retrieve the NodePort of the simple-nifi
service:
link:example$getting_started/getting_started.sh[role=include]
which should output the NodePort:
NodePort: 32595
Now build the full URL:
link:example$getting_started/getting_started.sh[role=include]
which should output a URL to connect to the NiFi web interface:
NiFi web interface: https://172.18.0.3:32595
Then connect to https://172.18.0.3:32595/nifi
and you should see the NiFi web login. After providing the username admin
and password admin
you are redirected to the NiFi web interface.
Have a look at the usage_guide/index.adoc page to find out more about the features of the NiFi Operator.