Skip to content

Commit

Permalink
Merge pull request #85 from shoplineapp/feature/support-podMonitor
Browse files Browse the repository at this point in the history
support podMonitor
  • Loading branch information
bluesky6529 authored Aug 30, 2022
2 parents 89e4ffd + 385024f commit 61bb07e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion simple/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
description: Helm chart with simple deployment/service template
name: simple
version: 0.8.0
version: 0.9.0
appVersion: 0.0.1
tillerVersion: ">=2.14.3"
25 changes: 25 additions & 0 deletions simple/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- range $podMonitorName, $ref := .Values.podMonitors }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ $podMonitorName }}
labels:
release: prometheus-operator
{{- if hasKey $ref "labels" }}
{{- range $key, $value := $ref.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
namespaceSelector:
matchNames:
{{- range $namespace := $ref.namespaceSelector }}
- {{ $namespace }}
{{- end }}
selector:
matchLabels:
{{- range $key, $value := $ref.selector.matchLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
podMetricsEndpoints: {{- toYaml $ref.podMetricsEndpoints | nindent 4 }}
{{- end}}
10 changes: 10 additions & 0 deletions simple/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ externalSecrets: {}
# endpoints:
# - port: http # port name of the service expose

# podMonitors:
# mongodb-observer:
# namespaceSelector:
# - shoplytics
# selector:
# matchLabels:
# app: mongodb-observer # which service you want to match
# podMetricsEndpoints:
# - port: http # port name of the service expose

# Don’t combine ScaledObject with Horizontal Pod Autoscaler (HPA)
# exmaple yaml please refer to example/example-keda.yaml
# KEDA:
Expand Down

0 comments on commit 61bb07e

Please sign in to comment.