Skip to content
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

[prometheus-elasticsearch-exporter] Add ability to set scheme for probes #4876

Open
timp87 opened this issue Sep 26, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@timp87
Copy link
Contributor

timp87 commented Sep 26, 2024

Is your feature request related to a problem ?

One may have security requirement to scrape exporters via HTTPS only.

Current 6.4.0 chart version of prometheus-elasticsearch-exporter allows one to:

  • create a secret with TLS key/cert via extraManifests and then mount it to the pod via secretMounts
  • create a configMap via extraManifests with web-config referring those TLS key/cert
  • mount that configMap to the pod via extraVolumes and extraVolumeMounts
  • add --web.config.file=<path_to_web_config> to args vu extraArgs

Now exporter can be scraped via HTTPS. The only problem here is hardcoded scheme in the liveness and readiness probes. To make it work properly one need a way to redefine with scheme.

Describe the solution you'd like.

Add ability to set scheme for probes to prometheus-elasticsearch-exporter.

This might be done via adding scheme option to service object in values.yaml.
Or service.metricsPort.name can be used as scheme for probes, like this:

@@ -149,6 +149,7 @@ spec:
             httpGet:
               path: /healthz
               port: {{ .Values.service.metricsPort.name }}
+              scheme: {{ upper .Values.service.metricsPort.name }}
             initialDelaySeconds: 5
             timeoutSeconds: 5
             periodSeconds: 5
@@ -156,6 +157,7 @@ spec:
             httpGet:
               path: /healthz
               port: {{ .Values.service.metricsPort.name }}
+              scheme: {{ upper .Values.service.metricsPort.name }}
             initialDelaySeconds: 1
             timeoutSeconds: 5
             periodSeconds: 5

Or there might be a better way like dedicating a separate variable for scheme

Describe alternatives you've considered.

N/A only forking

Additional context.

No response

@timp87 timp87 added the enhancement New feature or request label Sep 26, 2024
@timp87
Copy link
Contributor Author

timp87 commented Sep 26, 2024

NOTE: there is also deployment.metricsPort and podMonitor.scheme vars might be involved (used in templates/podmonitor.yaml) as well as serviceMonitor.scheme (used in templates/servicemonitor.yaml)

@timp87
Copy link
Contributor Author

timp87 commented Sep 26, 2024

The same approach would be better

livenessProbe:
httpGet:
path: /health
port: http
readinessProbe:
httpGet:
path: /health
port: http

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant