feat(argocd-image-updater): Optionally expose metrics (#1005)
* feat(argocd-image-updater): Optionally expose metrics Signed-off-by: Jan Pieper <kontakt@jan-pieper.info> * Apply suggestions from code review Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> * Add missing link references to README Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
parent
5e18356d25
commit
a4b05b43e2
7 changed files with 123 additions and 4 deletions
|
|
@ -60,6 +60,11 @@ spec:
|
|||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
{{ if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
containerPort: 8081
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
|
|
|
|||
25
charts/argocd-image-updater/templates/metrics-service.yaml
Normal file
25
charts/argocd-image-updater/templates/metrics-service.yaml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{{- if .Values.metrics.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
{{- if .Values.metrics.service.annotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.metrics.service.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "argocd-image-updater.labels" . | nindent 4 }}
|
||||
{{- with .Values.metrics.service.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
name: {{ include "argocd-image-updater.fullname" . }}-metrics
|
||||
spec:
|
||||
ports:
|
||||
- name: metrics
|
||||
protocol: TCP
|
||||
port: {{ .Values.metrics.service.servicePort }}
|
||||
targetPort: metrics
|
||||
selector:
|
||||
{{- include "argocd-image-updater.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
38
charts/argocd-image-updater/templates/servicemonitor.yaml
Normal file
38
charts/argocd-image-updater/templates/servicemonitor.yaml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "argocd-image-updater.fullname" . }}-metrics
|
||||
{{- with .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ . }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "argocd-image-updater.labels" . | nindent 4 }}
|
||||
{{- with .Values.metrics.serviceMonitor.selector }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.metrics.serviceMonitor.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: metrics
|
||||
{{- with .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ . }}
|
||||
{{- end }}
|
||||
path: /metrics
|
||||
{{- with .Values.metrics.serviceMonitor.relabelings }}
|
||||
relabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.metrics.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "argocd-image-updater.selectorLabels" . | nindent 6 }}
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue