Update ServiceMonitor to chart

This commit is contained in:
Mehran Kholdi 2020-04-28 22:52:56 +04:30
parent a6a859fc0e
commit 87dd918a74
3 changed files with 45 additions and 0 deletions

View File

@ -1,3 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "rawfile-csi.fullname" . }}-node
labels:
{{- include "rawfile-csi.labels" . | nindent 4 }}
component: node
spec:
type: ClusterIP
ports:
- name: metrics
port: 9100
targetPort: metrics
protocol: TCP
selector:
{{- include "rawfile-csi.selectorLabels" . | nindent 4 }}
component: node
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
@ -49,6 +67,9 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
ports:
- name: metrics
containerPort: 9100
volumeMounts:
- name: socket-dir
mountPath: /csi

View File

@ -0,0 +1,21 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "rawfile-csi.fullname" . }}-node
labels:
{{- include "rawfile-csi.labels" . | nindent 4 }}
spec:
endpoints:
- port: metrics
path: /metrics
interval: {{ .Values.serviceMonitor.interval }}
jobLabel: "helm.sh/chart"
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "rawfile-csi.selectorLabels" . | nindent 6 }}
component: node
{{- end }}

View File

@ -20,3 +20,6 @@ node:
enabled: false
imagePullSecrets: []
serviceMonitor:
enabled: true
interval: 15s