feat: add metrics
This commit is contained in:
@@ -27,6 +27,7 @@ Cloudflared Tunnel
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| image | object | `{"pullPolicy":"IfNotPresent","repository":"cloudflare/cloudflared","tag":"2026.3.0@sha256:6b599ca3e974349ead3286d178da61d291961182ec3fe9c505e1dd02c8ac31b0"}` | Default image |
|
||||
| metrics | object | `{"enabled":true}` | Metrics |
|
||||
| name | string | `""` | Name override of release |
|
||||
| protocol | string | `"auto"` | Protocol - Available values are auto, http2, and quic. |
|
||||
| resources | object | `{"requests":{"cpu":"1m","memory":"20Mi"}}` | Default resources |
|
||||
|
||||
@@ -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) -}}
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ name: ""
|
||||
# -- Protocol - Available values are auto, http2, and quic.
|
||||
protocol: auto
|
||||
|
||||
# -- Metrics
|
||||
metrics:
|
||||
enabled: true
|
||||
|
||||
# -- Secret configuration
|
||||
secret:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user