-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
Description
Is your feature request related to a problem? Please describe
I need to expose pod information on my custom metrics from the container.
In more specific, I need to add the following environment variable:
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
Currently, this is not supported on the deployment.
Describe the solution you'd like
Ideally, I would like to have a key/value filed where:
keyis the environment variable namevalueis thefieldPathwhere to retrieve the pod information
Example:
envFromFieldPath:
POD_NAME: "metadata.name"
Describe alternatives you've considered
I have considered changing myself the chart, and adding in the deployment.yaml:
{{- range $key, $value := .Values.extraEnvFieldPath }}
- name: {{ $key }}
valueFrom:
fieldRef:
fieldPath: {{ $value }}
{{- end }}
Then, I specify in my values.yaml:
extraEnvFieldPath:
POD_NAME: "metadata.name"
After I install the chart, I get on the container environment variables:
Environment:
POD_NAME: metrics-exporter-prometheus-mongodb-query-exporter-6545c56fbxgv (v1:metadata.name)
Additional context
NA