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

add service monitor #42

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/zot/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: v2.1.0
description: A Helm chart for Kubernetes
name: zot
type: application
version: 0.1.58
version: 0.1.59
32 changes: 32 additions & 0 deletions charts/zot/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if and .Values.metrics .Values.metrics.enabled .Values.metrics.serviceMonitor .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "zot.fullname" . }}
labels:
app.kubernetes.io/component: metrics
spec:
{{- if .Values.metrics.serviceMonitor.jobLabel }}
jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }}
{{- end }}
selector:
matchLabels:
{{- include "zot.selectorLabels" . | nindent 6 }}
endpoints:
- port: zot
{{- if .Values.metrics.serviceMonitor.interval }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.path }}
path: {{ .Values.metrics.serviceMonitor.path }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.scheme }}
scheme: {{ .Values.metrics.serviceMonitor.scheme }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/zot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,18 @@ strategy:
# maxUnavailable: 25%

podAnnotations: {}

# Metrics configuration
# NOTE: need enable metric extension in config.json
metrics:
# Start a prometheus exporter
enabled: false

# Prometheus Operator ServiceMonitor configuration
serviceMonitor:
# Start a ServiceMonitor for Prometheus Operator
enabled: false
# Specify the interval at which metrics should be scraped
interval: "30s"
# Specify the path to scrape metrics from
path: "/metrics"
Loading