mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-17 16:46:51 +02:00
Updated template chart
This commit is contained in:
@@ -25,4 +25,4 @@ kube-prometheus-stack:
|
||||
- 10.0.0.2
|
||||
kubeScheduler:
|
||||
endpoints:
|
||||
- 10.0.0.2
|
||||
- 10.0.0.2
|
||||
|
||||
@@ -2,7 +2,7 @@ apiVersion: v2
|
||||
name: template
|
||||
description: A Helm library chart containing common templates, keeping application templates short
|
||||
type: library
|
||||
version: 0.1.19
|
||||
version: 0.1.20
|
||||
maintainers:
|
||||
- name: Jim Martens
|
||||
url: https://2martens.de
|
||||
@@ -10,8 +10,8 @@ sources:
|
||||
- https://git.2martens.de/2martens/cloud-configuration
|
||||
annotations:
|
||||
artifacthub.io/changes: |
|
||||
- kind: fixed
|
||||
description: Fixed annotations
|
||||
- kind: changed
|
||||
description: Added support for Prometheus operator with pod monitor
|
||||
artifacthub.io/signKey: |
|
||||
fingerprint: F0F153B65BAD467201D7544E47393ABD1F96B7C8
|
||||
url: https://mafiasi.de/pks/key/47393ABD1F96B7C8.asc
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{{- include "template.podmonitor" . -}}
|
||||
@@ -56,6 +56,11 @@ application:
|
||||
|
||||
prometheus:
|
||||
enabled: true
|
||||
# only enable if you have the Prometheus operator installed, otherwise it will fail due to missing CRDs
|
||||
useCRDs: false
|
||||
# namespace: the namespace of the Prometheus installation
|
||||
# the value is templated
|
||||
namespace:
|
||||
|
||||
# Overwrite with application specific environment variables
|
||||
# Each item has key and value, where the value is parsed as a template
|
||||
|
||||
@@ -16,13 +16,9 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
{{- if $.Values.prometheus.enabled }}
|
||||
{{- if and $.Values.prometheus.enabled (not $.Values.prometheus.useCRDs) $.Values.application.isSpring }}
|
||||
prometheus.io/scrape: "true"
|
||||
{{- if $.Values.application.isSpring }}
|
||||
prometheus.io/path: /actuator/prometheus
|
||||
{{- else }}
|
||||
prometheus.io/path: /metrics
|
||||
{{- end }}
|
||||
prometheus.io/port: "{{ $.Values.application.actuatorPort }}"
|
||||
{{- end }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{{- define "template.podmonitor" -}}
|
||||
{{- if and .Values.prometheus.enabled .Values.prometheus.useCRDs .Values.application.isSpring }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PodMonitor
|
||||
metadata:
|
||||
name: {{ include "template.fullname" . }}
|
||||
namespace: {{ tpl .Values.prometheus.namespace . | default "observability" }}
|
||||
labels:
|
||||
{{- include "template.labels" . | nindent 4 }}
|
||||
spec:
|
||||
podMetricsEndpoints:
|
||||
- port: {{ .Values.application.actuatorPort }}
|
||||
path: /actuator/prometheus
|
||||
selector:
|
||||
{{- include "template.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user