diff --git a/charts/cloudflared/Chart.yaml b/charts/cloudflared/Chart.yaml index 1611060..a1f4938 100644 --- a/charts/cloudflared/Chart.yaml +++ b/charts/cloudflared/Chart.yaml @@ -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 diff --git a/charts/cloudflared/templates/deployment.yaml b/charts/cloudflared/templates/deployment.yaml index a5adb90..dec2c68 100644 --- a/charts/cloudflared/templates/deployment.yaml +++ b/charts/cloudflared/templates/deployment.yaml @@ -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 diff --git a/charts/cloudflared/templates/servicemonitor.yaml b/charts/cloudflared/templates/podmonitor.yaml similarity index 56% rename from charts/cloudflared/templates/servicemonitor.yaml rename to charts/cloudflared/templates/podmonitor.yaml index 41b26fa..a8689ba 100644 --- a/charts/cloudflared/templates/servicemonitor.yaml +++ b/charts/cloudflared/templates/podmonitor.yaml @@ -1,26 +1,26 @@ -{{- 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: @@ -28,9 +28,9 @@ spec: - {{ .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 }} diff --git a/charts/cloudflared/templates/svc.yaml b/charts/cloudflared/templates/svc.yaml deleted file mode 100644 index cfafba5..0000000 --- a/charts/cloudflared/templates/svc.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }} - namespace: {{ .Release.Namespace | quote }} - labels: {{- include "base.labels.standard" . | nindent 4 }} - {{- with .Values.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if and .Values.service.clusterIP (eq .Values.service.type "ClusterIP") }} - clusterIP: {{ .Values.service.clusterIP }} - {{- end }} - {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{ if eq .Values.service.type "LoadBalancer" }} - loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} - {{ end }} - {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - ports: - - name: http - port: {{ .Values.service.ports.http }} - targetPort: http - protocol: TCP - {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.http)) }} - nodePort: {{ .Values.service.nodePorts.http }} - {{- end }} - selector: {{- include "base.labels.matchLabels" . | nindent 4 }} diff --git a/charts/cloudflared/values.yaml b/charts/cloudflared/values.yaml index 8215eec..1be5a03 100644 --- a/charts/cloudflared/values.yaml +++ b/charts/cloudflared/values.yaml @@ -39,9 +39,9 @@ readinessProbe: failureThreshold: 1 successThreshold: 1 -serviceMonitor: +podMonitor: enabled: false - extraLabels: - release: prometheus + extraLabels: {} +# release: prometheus interval: 30s scrapeTimeout: 30s