Merge "helm-toolkit prometheus service annotation clean up"
This commit is contained in:
commit
95bcb412f2
@ -22,14 +22,14 @@ limitations under the License.
|
||||
# pod's declared ports (default is a port-free target if none are declared).
|
||||
|
||||
{{- define "helm-toolkit.snippets.prometheus_pod_annotations" -}}
|
||||
{{- $pod := index . 0 -}}
|
||||
{{- if $pod.prometheus_scrape }}
|
||||
prometheus.io/scrape: {{ $pod.prometheus_scrape | quote }}
|
||||
{{- $config := index . 0 -}}
|
||||
{{- if $config.scrape }}
|
||||
prometheus.io/scrape: {{ $config.scrape | quote }}
|
||||
{{- end }}
|
||||
{{- if $pod.prometheus_path }}
|
||||
prometheus.io/path: {{ $pod.prometheus_path | quote }}
|
||||
{{- if $config.path }}
|
||||
prometheus.io/path: {{ $config.path | quote }}
|
||||
{{- end }}
|
||||
{{- if $pod.prometheus_port }}
|
||||
prometheus.io/port: {{ $pod.prometheus_port | quote }}
|
||||
{{- if $config.port }}
|
||||
prometheus.io/port: {{ $config.port | quote }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
@ -21,9 +21,17 @@ limitations under the License.
|
||||
# service then set this appropriately.
|
||||
|
||||
{{- define "helm-toolkit.snippets.prometheus_service_annotations" -}}
|
||||
{{- $endpoint := index . 0 -}}
|
||||
prometheus.io/scrape: {{ $endpoint.scrape | quote }}
|
||||
prometheus.io/scheme: {{ $endpoint.scheme.default | quote }}
|
||||
prometheus.io/path: {{ $endpoint.path.default | quote }}
|
||||
prometheus.io/port: {{ $endpoint.scrape_port | quote }}
|
||||
{{- $config := index . 0 -}}
|
||||
{{- if $config.scrape }}
|
||||
prometheus.io/scrape: {{ $config.scrape | quote }}
|
||||
{{- end }}
|
||||
{{- if $config.scheme }}
|
||||
prometheus.io/scheme: {{ $config.scheme | quote }}
|
||||
{{- end }}
|
||||
{{- if $config.path }}
|
||||
prometheus.io/path: {{ $config.path | quote }}
|
||||
{{- end }}
|
||||
{{- if $config.port }}
|
||||
prometheus.io/port: {{ $config.port | quote }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user