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

scaffolded helm chart: add podmonitor/prometheusrule (optional) #101

Open
cbarbian-sap opened this issue Apr 15, 2024 · 0 comments
Open

Comments

@cbarbian-sap
Copy link
Contributor

The scaffolded helm chart (./scaffold/templates/chart) should be able to optionally render a PodMonitor object such as

{{- if .Values.metrics.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: {{ include "xxx.fullname" . }}
  labels:
    {{- include "xxx.labels" . | nindent 4 }}
spec:
  namespaceSelector:
    matchNames:
    - {{ .Release.Namespace }}
  selector:
    matchLabels:
      {{- include "xxx.selectorLabels" . | nindent 6 }}
  podMetricsEndpoints:
  - port: metrics
{{- end }}

and a PrometheusRule object such as

{{- if and .Values.metrics.prometheusRule.enabled .Values.metrics.prometheusRule.rules }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: {{ include "xxx.fullname" . }}
  labels:
    {{- include "xxx.labels" . | nindent 4 }}
spec:
  groups:
  - name: {{ include "xxx.name" . }}
    rules:
    {{- toYaml .Values.metrics.prometheusRule.rules | nindent 4 }}
{{- end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant