feat: add metrics

This commit is contained in:
2026-05-07 22:32:07 -05:00
parent 0fbd8c98ed
commit 7bd5e48581
3 changed files with 31 additions and 3 deletions

View File

@@ -22,6 +22,9 @@ controllers:
- --protocol
- {{ .Values.protocol }}
- --no-autoupdate
{{- if .Values.metrics.enabled }}
- --metrics 0.0.0.0:20241
{{- end }}
- run
- --token
- $(CF_MANAGED_TUNNEL_TOKEN)
@@ -32,10 +35,30 @@ controllers:
name: {{ include "secret.name" . }}
key: {{ include "secret.key" . }}
resources:
{{- with .Values.resources }}
resources:
{{- with .Values.resources }}
{{- toYaml . | nindent 10 }}
{{ end }}
{{ end }}
{{- if .Values.metrics.enabled }}
service:
main:
controller: main
ports:
metrics:
port: 20241
targetPort: 20241
serviceMonitor:
main:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "cloudflared.name" . }}
app.kubernetes.io/instance: {{ include "cloudflared.name" . }}
serviceName: '{{ include "bjw-s.common.lib.chart.names.fullname" $ }}'
endpoints:
- port: metrics
interval: 30s
scrapeTimeout: 10s
path: /metrics
{{- end }}
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "cloudflared.hardcodedValues" . | fromYaml) -}}