# Guide for Node-Red and Kafka-EventHubs Plugin For tests purposes, this guide will show how you can have a Node-Red running and using stream accessories in a development environment. ## Node-Red The Node-Red will run in Kubernetes environment. So you must have minikube for tests. * First of all you must have docker installed. Minikube will need for virtualization. * Install minikube: ```shell= wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 chmod +x minikube-linux-amd64 sudo mv minikube-linux-amd64 /usr/local/bin/minikube ``` * Install helm: https://helm.sh/docs/intro/install/ * Using this chart helm https://artifacthub.io/packages/helm/k8s-at-home/node-red you can install Node-Red without problems. You must be aware that Node-Red needs a persistent volume, otherwise, you'll lost all your work when you turn off your machine. ```yaml= # # IMPORTANT NOTE # # This chart inherits from our common library chart. You can check the default values/options here: # https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml # global: fullnameOverride: node-red-2 image: # -- image repository repository: nodered/node-red # -- image tag tag: 2.1.4 # -- image pull policy pullPolicy: IfNotPresent # -- environment variables. See [image docs](https://nodered.org/docs/getting-started/docker) for more details. # @default -- See below env: # -- Set the container timezone TZ: UTC # -- Node.js runtime arguments NODE_OPTIONS: # -- Setting to `true` starts Node-RED with the projects feature enabled NODE_RED_ENABLE_PROJECTS: # -- Setting to `true` starts Node-RED in safe (not running) mode NODE_RED_ENABLE_SAFE_MODE: # -- Location of the flows configuration file. # If you set `FLOWS: ""` then the flow file can be set via the `flowFile` property in the `settings.js` file. FLOWS: flows.json # -- Configures service settings for the chart. # @default -- See values.yaml service: main: ports: http: port: 1880 ingress: # -- Enable and configure ingress settings for the chart under this key. # @default -- See values.yaml main: enabled: true # -- Configure persistence settings for the chart under this key. # @default -- See values.yaml persistence: data: enabled: true mountPath: /data accessMode: ReadWriteOnce size: 1Gi ``` * Create a file called values.yaml and paste this content. After that, create the chart: ```bash= helm repo add k8s-at-home https://k8s-at-home.com/charts/ helm repo update helm install node-red k8s-at-home/node-red -f values.yaml ``` * The last command will help you with configuration, as PVC and Ingresses. Obs.: You can change the field "fullNameOverride" to put your own name. * Your Node-Red is running somewhere in default namespace * `kubectl get pods` will show you * After that, type `kubectl port-forward <pod name> 1880:1880` * Access your browser on `http://localhost:1880` and you should have access to Node-Red. ## Kafka-EventHubs plugin **Manage Palette**>>**Install** If your project is in npm registry, automatically will appear in nodes to install. If not, you will need to pass a tarball (npm pack) of your plugin for Node-Red. As all plugins in Node-Red, you must install and uninstall using the palette. ![](https://i.imgur.com/qkw427v.png) ![](https://i.imgur.com/fEP4itF.png) If the palette is not working, you can install the plugin directly inside the container using `kubectl exec`, entering in container and applying `npm install <package>`.