Skip to content

Commit

Permalink
feat: update pod monitor for argo-event
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKwan-shopline committed Feb 1, 2024
1 parent d783e22 commit abdc054
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 24 deletions.
29 changes: 29 additions & 0 deletions argo-event/templates/eventbus_podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.podMonitor.eventbus.enable }}
# Used for Promotheous
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Values.name }}-eventbus
labels:
release: prometheus-operator
{{- with .Values.labels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.podMonitor.eventbus.labels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
{{- if .Values.podMonitor.eventbus.namespace -}}
{{ toYaml .Values.podMonitor.eventbus.namespace | nindent 6 }}
{{- else }}
- {{ .Release.Namespace }}
{{- end }}
podMetricsEndpoints:
- port: metrics
selector:
matchLabels:
owner-name: {{ .Values.name }}
app: {{ .Values.name }}-eventbus
{{ end }}
29 changes: 29 additions & 0 deletions argo-event/templates/eventsource_podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.podMonitor.eventsource.enable }}
# Used for Promotheous
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Values.name }}-eventsource
labels:
release: prometheus-operator
{{- with .Values.labels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.podMonitor.eventsource.labels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
{{- if .Values.podMonitor.eventsource.namespace -}}
{{ toYaml .Values.podMonitor.eventsource.namespace | nindent 6 }}
{{- else }}
- {{ .Release.Namespace }}
{{- end }}
podMetricsEndpoints:
- port: metrics
selector:
matchLabels:
owner-name: {{ .Values.name }}
app: {{ .Values.name }}-eventsource
{{ end }}
29 changes: 29 additions & 0 deletions argo-event/templates/sensor_podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.podMonitor.eventsensor.enable }}
# Used for Promotheous
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Values.name }}-sensor
labels:
release: prometheus-operator
{{- with .Values.labels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.podMonitor.eventsensor.labels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
{{- if .Values.podMonitor.eventsensor.namespace -}}
{{ toYaml .Values.podMonitor.eventsensor.namespace | nindent 6 }}
{{- else }}
- {{ .Release.Namespace }}
{{- end }}
podMetricsEndpoints:
- port: metrics
selector:
matchLabels:
owner-name: {{ .Values.name }}
app: {{ .Values.name }}-sensor
{{ end }}
23 changes: 0 additions & 23 deletions argo-event/templates/servicemonitor.yaml

This file was deleted.

28 changes: 27 additions & 1 deletion argo-event/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,30 @@ ingress:
# Example
# host: testing.com

# path(string): path for this ingress
# path(string): path for this ingress

# podMonitor: optional, used to create podMonitor for argo event
podMonitor:
eventsource:
enable: false
# eventsoruce: setting for eventsource pod monitor
# field:
# enable(bool): to enable this pod monitor
# labels: extra label for this pod monitor
# namespace: the namespace of this pod monitor to watch

eventbus:
enable: false
# eventbus: setting for eventbus pod monitor
# field:
# enable(bool): to enable this pod monitor
# labels: extra label for this pod monitor
# namespace: the namespace of this pod monitor to watch

eventsensor:
enable: false
# eventsensor: setting for eventsensor pod monitor
# field:
# enable(bool): to enable this pod monitor
# labels: extra label for this pod monitor
# namespace: the namespace of this pod monitor to watch

0 comments on commit abdc054

Please sign in to comment.