Closed svenfoo closed 1 month ago
Hi @svenfoo
Yes, you are right. Thanks for letting me know.
I will merge the fix, but the entrypoint.sh
is largely obsolete now that the exporter natively supports configuration via environment variables. I was contemplating removing it when I made the latest release, but decided to keep it for compatibility, but at some point I will probably remove it.
I will merge the fix, but the
entrypoint.sh
is largely obsolete now that the exporter natively supports configuration via environment variables. I was contemplating removing it when I made the latest release, but decided to keep it for compatibility, but at some point I will probably remove it.
Thanks for letting us now. I will update our Kubernetes setup to use environment variables then.
Looked into that now and our usage scenario is somewhat difficult to implement only with environment variables. We want to have idrac-exporter running on each node of the cluster, so we are using a daemonset. And each node has its own iDRAC credentials, so we need to look them up at run-time depending on the node name. This is easily implemented by mounting the credentials of all nodes and letting entrypoint.sh
do it's magic.
Maybe there's a simpler way to implement this. If idrac-exporter had an environment variable, or configuration option, to tell it to dynamically obtain the credentials based on the node name, that would help a lot.
Alright, so we should probably keep the entry point in that case. However, I guess it can be simplified quite a bit, for example (not actually tested):
#!/bin/bash
auth_file="/authconfig/$NODE_NAME"
if [ -f "$auth_file" ]; then
export CONFIG_DEFAULT_USERNAME=$(cut -f1 -d= $auth_file)
export CONFIG_DEFAULT_PASSWORD=$(cut -f2- -d= $auth_file)
fi
exec bin/idrac_exporter "$@"
In this way you will still be able to have the per-node definition of the credentials. The rest of the configuration can either be configured via environment variables, or by mapping a configuration file into the container.
What do you think?
What do you think?
That should work for us. It's more or less what I hacked up yesterday by overriding the entrypoint command. But I would prefer if we wouldn't have to do that.
Sounds good, then I will try to push an update later today.
Fixed by commit fa0cd16de9414ee9e4dc70f40528f1a88226f467
After upgrading from
1.1.0
to1.3.1
the idrac-exporter pod crashes on startup with the following error message:To me it looks like the
entrypoint.sh
script has two flaws:/app/config/idrac.yml
but the folder/app/config
does not exist in the Docker image.$config
variable accordingly.