add part two
This commit is contained in:
49
2.ArgoCD/templates/applicationset/servicemonitor.yaml
Normal file
49
2.ArgoCD/templates/applicationset/servicemonitor.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
{{- if and .Values.applicationSet.enabled .Values.applicationSet.metrics.enabled .Values.applicationSet.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "argo-cd.applicationSet" . }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.applicationSet.metrics.serviceMonitor.namespace | quote }}
|
||||
{{- else }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
{{- end }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.selector }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.applicationSet.metrics.serviceMonitor.selector "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/component: applicationSet
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: http-metrics
|
||||
path: /metrics
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.applicationSet.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.applicationSet.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.honorLabels }}
|
||||
honorLabels: {{ .Values.applicationSet.metrics.serviceMonitor.honorLabels }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.applicationSet.metrics.serviceMonitor.relabelings }}
|
||||
relabelings: {- include "common.tplvalues.render" ( dict "value" .Values.applicationSet.metrics.serviceMonitor.relabelings "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
app.kubernetes.io/part-of: applicationSet
|
||||
{{- end }}
|
Reference in New Issue
Block a user