Skip to content

Commit

Permalink
move from serviceMonitor to podMomitor on cloudflared
Browse files Browse the repository at this point in the history
  • Loading branch information
damoun committed Nov 24, 2023
1 parent 0d4cabb commit d5cba12
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 48 deletions.
2 changes: 1 addition & 1 deletion charts/cloudflared/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: cloudflared
description: Cloudflared tunnel Helm Chart
type: application
version: 2.0.2
version: 3.0.1
appVersion: "2023.10.0"
dependencies:
- name: base
Expand Down
4 changes: 4 additions & 0 deletions charts/cloudflared/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ spec:
{{- end }}
env: {{- toYaml .Values.env | nindent 12 }}
envFrom: {{- toYaml .Values.envFrom | nindent 12 }}
ports:
- containerPort: 2000
name: metrics
protocol: TCP
args:
- tunnel
- --no-autoupdate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{{- if .Values.serviceMonitor.enabled }}
{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
kind: PodMonitor
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "base.labels.standard" $ | nindent 4 }}
{{- toYaml .Values.serviceMonitor.extraLabels | nindent 4 }}
{{- toYaml .Values.podMonitor.extraLabels | nindent 4 }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: http
interval: {{ .Values.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
podMonitorEndpoints:
- port: metrics
interval: {{ .Values.podMonitor.interval }}
scrapeTimeout: {{ .Values.podMonitor.scrapeTimeout }}
scheme: http
path: /metrics
{{- if .Values.serviceMonitor.metricRelabelings }}
{{- if .Values.podMonitor.metricRelabelings }}
metricRelabelings:
{{ toYaml .Values.serviceMonitor.metricRelabelings | indent 4 }}
{{ toYaml .Values.podMonitor.metricRelabelings | indent 4 }}
{{- end }}
jobLabel: {{ .Release.Name }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
selector:
matchLabels: {{- include "base.labels.matchLabels" $ | nindent 6 }}
{{- if .Values.serviceMonitor.targetLabels }}
{{- if .Values.podMonitor.targetLabels }}
targetLabels:
{{- range .Values.serviceMonitor.targetLabels }}
{{- range .Values.podMonitor.targetLabels }}
- {{ . }}
{{- end }}
{{- end }}
Expand Down
33 changes: 0 additions & 33 deletions charts/cloudflared/templates/svc.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions charts/cloudflared/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ readinessProbe:
failureThreshold: 1
successThreshold: 1

serviceMonitor:
podMonitor:
enabled: false
extraLabels:
release: prometheus
extraLabels: {}
# release: prometheus
interval: 30s
scrapeTimeout: 30s

0 comments on commit d5cba12

Please sign in to comment.