Substitute password in helm values file prometheus blackbox exporter http target

1/9/2020

I'm trying to do an aliveness-check to rabbitmq management console via http api. I have the target in the helm values file under endpoints; I'm using http probe.

endpoints:
    - module: rabbit_alive_check
      port: http
      scheme: http
      url: "http://username:password@nodeip:15672/api/aliveness-test/%2F"

The output comes as expected. But I'm looking to substitute the password which I've already encrypted in helm secrets and not have it hardcoded in the url. I adopted prometheus-blackbox exporter from https://github.com/helm/charts/tree/master/stable/prometheus-blackbox-exporter.

How to call the password from helm secrets.yaml?

-- karthick
amazon-web-services
helm-tls
kubernetes-helm
kubernetes-secrets
prometheus-blackbox-exporter

1 Answer

1/9/2020

You cannot inject secret value into values.yaml, since values.yaml is actually the input for your Helm Chart and it does not use any substitution.

I'm not sure where the code excerpt comes from, but a possible workaround for health checks could be having a custom script.

-- RafaƂ Leszko
Source: StackOverflow