helm-charts
helm-charts copied to clipboard
[prometheus-snmp-exporter] Add optional auth section
What this PR does / why we need it
This PR passes the auth parameters available in newer versions of snmp-exporter from the chart to the application configuration.
Which issue this PR fixes
- fixes #3940
Special notes for your reviewer
Checklist
- [x] DCO signed
- [x] Chart Version bumped
- [x] Title of the PR starts with chart name (e.g.
[prometheus-couchdb-exporter]
)
Hi @xiu, just checking to see if you have any feedback for this PR?
Thanks, Brian
Hi @walker-tom I've fixed the merge conflict. Do you need me to do anything else?
Thanks, Brian
Hi @walker-tom I've fixed the merge conflict. Do you need me to do anything else?
Thanks, Brian
Hi Brian, thanks for updating your PR, could you update the Chart version in Chart.yaml
, I think it got lost during the merge conflict. Thanks!
:facepalm: Thanks. I think that should fix it.
This change seems to be broken in the default case where you don't specify an auth in the params[*]
. It's attempting to apply the default $.Values.serviceMonitor.auth
(which is an array, defaulting to [public_v2]
) to a single item in the array:
auth:
- {{ .auth | default $.Values.serviceMonitor.auth }}
So it's ending up being:
auth:
- [public_v2]
Here's the error from my HelmRelease install:
ServiceMonitor.monitoring.coreos.com "snmp-exporter-prometheus-snmp-exporter-<target1>" is invalid: spec.endpoints[0].params.auth[0]: Invalid value: "array": spec.endpoints[0].params.auth[0] in body must be of type string: "array" && cannot patch "snmp-exporter-prometheus-snmp-exporter-<target2>" with kind ServiceMonitor: ServiceMonitor.monitoring.coreos.com "snmp-exporter-prometheus-snmp-exporter-<target2>" is invalid: spec.endpoints[0].params.auth[0]: Invalid value: "array": spec.endpoints[0].params.auth[0] in body must be of type string: "array"
This change seems to be broken in the default case where you don't specify an auth in the
params[*]
. It's attempting to apply the default$.Values.serviceMonitor.auth
(which is an array, defaulting to[public_v2]
) to a single item in the array:
I apologize for the mistake. Thanks for fixing it.
Is there any documentation that gives an example of how to use SNMPv3 auth in prometheus-snmp-exporter via Helm?
@abctaylor You will need to create an auths
configuration for your targets in your SNMP Exporter. As documented in auth-split-migration.md this is now separate to the modules
configuration. You can see examples in the generator file format for the settings available for SNMPv3. You then have at least two options for getting this configuration into your Container:
- Create an
auths
configuration YAML file for the exporter in aSecret
and mount that into your Container usingextraVolumes
andextraVolumeMounts
, then pass in an argument--config.file=/path/to/extra/auths/file
via the extraextraArgs
. SNMP Exporter will then load up a this additional configuration - Add the
auths
configuration to your existing SNMP Exporter configuration file, set the relevant sensitive data as environment variables usingenvFrom
and then reference those env vars in yourauths
section using--config.expand-environment-variables
as mentioned here
Hope this helps.