-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm install from values file #198
Comments
hi @beasteers, Had no time to check on this one. Is this still needed for you? |
No worries, I ended up forking and did the install by overriding container command to install before launching node-red. It'd be a good thing to have built-in to the chart though |
Hi, The modules can be installed via API request (POST /nodes) and existing sidecar and preserves privilege escalation in the container as npm needs admin rights. Actually, for automating this process I am missing the node module name from the GET /flows json v2 result to check if the node is installed (GET /nodes)and if not installing the corresponding node module (POST /nodes) . Workaround would be an extra helm list value witch installs the npm modules from an extra sidecar. The modules had to declared separately and have to match with the flows nodes modules. I am facing the same feature for my installation. Not sure witch method is the best to choose from. |
I started a thread in the node-red user forum. https://discourse.nodered.org/t/api-install-flows-and-modules-automated-via-api-requests/78962/3
This means the package module names have to be declared manually. If using the sidecar in the helm chart for import flows this have to match. I can write a python script for installing extra node modules, same way like in the sidecar for flows. Not sure if this is the best way to do it. Declare extra NPM Module Names in a ConfigMap. Watch the ConfigMap and interate threw the module names and install each one.... Have to check if this is possible within the existing sidecar, or even within the flow_refresh script. There will be some ups and downside depending on how you use the helm chart. @beasteers and @dirien |
Have done some testing with the flow_refresh.py script. I think it works very well....New Script
Node Modules will be installed shortly after pod startup. ExtraEnv is not the best place to store the node module names. This is just for a first poc or test. Maybe a configMap would be fit better. python3 flow_refresh.py
|
Hey @beasteers, Hope the feature from @hinrichd is helping you. Closing this issue for now. |
There's one issue with the current solution - this doesn't support packages that are needed in the settings.js file which will prevent nodered from starting in the first place - e.g. authentication providers, themes, etc. I guess the best place for this to live would be in an init container? |
Is your feature request related to a problem? Please describe.
Many times, people want to use custom nodes in nodered, but there isn't an obvious way to install them using the configuration. Basically, just looking for a way to do
npm i pkgA
fromvalues.yaml
.Describe the solution you'd like
Some options:
values.yaml
.startupCommands: ["npm i pkgA"]
orinstallPackages: ["pkgA"]
tovalues.yaml
Describe alternatives you've considered
I'm working on getting the right init container/sidecar setup but need to figure out the right base image, volume mounts, and other config necessary. I'm not sure I understand the difference between
/data/package.json
and/usr/src/node-red/package.json
thoSearch
Code of Conduct
Additional context
No response
The text was updated successfully, but these errors were encountered: