Skip to content

Commit

Permalink
Don't create prometheus resources when CRD is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
bobertrublik committed Oct 1, 2024
1 parent 3cbd811 commit ae0202a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/db-instances/templates/postgres_exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ spec:
{{- include "db-instances.selectorLabels" $ | nindent 4 }}
db-instance: {{ $name }}
---
{{- if $.Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }}
{{- if and $value.serviceMonitor $value.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down Expand Up @@ -123,7 +124,9 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
---
{{- if $.Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }}
{{- if and $value.podMonitor $value.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
Expand Down Expand Up @@ -176,3 +179,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit ae0202a

Please sign in to comment.