This use case will show how to use the k6 Helm chart for a load test on NiFi. k6 will be used to send a pre-defined number of binary files in a pre-defined duration.
First, you have to install and configure NiFi and a listener processor.
You can follow the FADI installation instructions to deploy Nifi.
The ListenHTTP processor will be used to consume incoming data from k6.
For that NiFi processor to be reachable from a browser, we need to add a NodePort
service to it. For that, navigate to the processors
part of service
section in values.yaml file and add this config :
processors:
enabled: true
ports:
- name: listenHTTP
port: 7001
targetPort: 7001
Then, upgrade the NiFi release :
helm upgrade <your_release> <your_Nifi_helm_repo>
Then, you can go to the Nifi UI, login and add the ListenHTTP
processor with the port number defined in the values.yaml file.
First, edit the values.yaml
file :
target:
virtualuser: 1
iterations: 100
duration: "10s"
host: <your_Nifi_server_address>
port: <your_Nifi_ListenHTTP_port>
fileUpload: <path_to_your_file>
conf:
schedule: "*/3 * * * *"
virtualuser
: number of virtual users simultaneously connectediterations
: number of copies of the file sent per virtual userduration
: period during which all files are senthost
: the address of your Nifi serverport
: the port number of yourListenHTTP
processorfileUpload
: path to the file that will be copied and sent for the load testingschedule
: as a cron job you need to set a schedule (every 3 min in this example)
Now, you can lauch the load test by typing this command :
helm install k6 .
To see the results, type this command :
kubectl logs <your_k6_pod>