Closed SquupS closed 6 months ago
@SquupS , Indeed that seems like a problem in reading the plugin from its source location. Are you passing the main.js
+ package.json
file of that plugin, or just the main.js
? Both are needed so Headlamp knows whether the plugin is compatible.
If you are passing both files, can you share more details about your Headlamp deployment?
@yolossn , can you follow up with @SquupS 's replies? Maybe we should also update this post just with a quick note that the package.json needs to be included as well (no need to modify the whole post/screenshots, just an Update: notice where needed) https://headlamp.dev/blog/2022/10/get-up-to-speed-deploying-headlamp-with-plugins/
@joaquimrocha @yolossn yes, both files are provided within the folder
Besides that, it is just a pretty default deployment with the following args and envs
args:
- '-in-cluster'
- '-insecure-ssl'
- '-base-url=/headlamp'
- '-plugins-dir=/headlamp/plugins/'
env:
- name: HEADLAMP_CONFIG_BASE_URL
value: /headlamp
@SquupS Can you share the response that you get when accessing <YOUR-HEADLAMP-URL>/headlamp/plugins
?
Sure @yolossn
[ "/headlamp/static-plugins/prometheus", "/headlamp/plugins/headlamp-plugins" ]
Looks like you have two instances of Prometheus plugin loaded. One from the static plugins and the other that is added by you.Do you see any errors in the console log?
There are some, yes @yolossn
Is this static one some automatically added plugin? Because if this gets ship per default, I would not have added one manually :-) But also without adding the plugin unter /headlamp/plugins I got no prometheus button/charts shown
@SquupS Yes the static plugins are the ones that are preinstalled with headlamp and we do ship the Prometheus plugin by default with headlamp. I checked if the Prometheus plugin is working properly with our latest version and it is working as expected. Can you try installing the latest version of headlamp and check if it is working for you.
Sure I can redeploy @yolossn But I was already using the latest 0.23.0 Version.
@yolossn redeployed and removed my added plugin, so that only the static one is left. I receive the same errors like shown before and no button is shown for metrics.
Are there maybe any uncommented preconditions in order for that button to appear? I also compared my helm Chart to the one you provide here and those are more or less identical
Thanks for the update, Can you expand the errors that you see in the console and share it?
@yolossn hope that suits your needs?
@SquupS After a couple of attempts I am able to reproduce this error. Apparently it is occurring due to the "-base-url" argument, It works properly when the -base-url
argument isn't set. I will work on a fix for this.
@yolossn that sounds awesome. Looking foward to the fix. Thanks a lot for the investigation.
@SquupS Could you please test the custom container build with the fix I created and pushed to ttl.sh/headlamp-base-path-fix:latest
? This is to verify if the solution resolves the issue with using the Prometheus plugin correctly. Thanks!
@yolossn Can confirm, that the metrics button is now showing up per default, without having to run an init container or such.
I have build and shipped the prometheus plugin to the 0.23.0 inCluster Deployment of headlamp.
However, the plugin is not shown under settings/plugins, nor do I see the switch to turn it on.
The plugin folder is propperly placed in /headlamp/plugins/ which is also the source for the -plugin-dir flag.
Any hints what I have missed?