Add PodMonitor to gha-runner-scale-set-controller chart

This commit is contained in:
CRA Fabio Yasuo Furushou 2024-08-06 16:43:12 +09:00
parent a152741a1a
commit 6a850e9ea8
3 changed files with 29 additions and 0 deletions

View File

@ -111,6 +111,10 @@ Create the name of the service account to use
{{- include "gha-runner-scale-set-controller.fullname" . }}-listener
{{- end }}
{{- define "gha-runner-scale-set-controller.managerPodMonitor" -}}
{{- include "gha-runner-scale-set-controller.fullname" . }}
{{- end }}
{{- define "gha-runner-scale-set-controller.leaderElectionRoleName" -}}
{{- include "gha-runner-scale-set-controller.fullname" . }}-leader-election
{{- end }}

View File

@ -0,0 +1,23 @@
{{- if hasKey .Values "metrics" }}
{{- if and (hasKey .Values.metrics "podMonitor") .Values.metrics.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
labels:
{{- include "gha-runner-scale-set-controller.labels" . | nindent 4 }}
name: {{ include "gha-runner-scale-set-controller.managerPodMonitor" . }}
namespace: {{ .Release.Namespace }}
spec:
podMetricsEndpoints:
{{- with .Values.metrics }}
- path: {{ .listenerEndpoint }}
port: metrics
{{- end }}
selector:
matchLabels:
{{- include "gha-runner-scale-set-controller.selectorLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- end }}
{{- end }}

View File

@ -93,6 +93,8 @@ priorityClassName: ""
# controllerManagerAddr: ":8080"
# listenerAddr: ":8080"
# listenerEndpoint: "/metrics"
# podMonitor:
# enabled: true
flags:
## Log level can be set here with one of the following values: "debug", "info", "warn", "error".