dfb15f1d1ea2367d116f73b7cdb882b7613b8b5a
[demo.git] / vnfs / DAaaS / collection / charts / prometheus-node-exporter / templates / daemonset.yaml
1 apiVersion: extensions/v1beta1
2 kind: DaemonSet
3 metadata:
4   name: {{ template "prometheus-node-exporter.fullname" . }}
5   labels: {{ include "prometheus-node-exporter.labels" . | indent 4 }}
6 spec:
7   selector:
8     matchLabels:
9       app: {{ template "prometheus-node-exporter.name" . }}
10       release: {{ .Release.Name }}
11   updateStrategy:
12     type: RollingUpdate
13     rollingUpdate:
14       maxUnavailable: 1
15   template:
16     metadata:
17       labels: {{ include "prometheus-node-exporter.labels" . | indent 8 }}
18     spec:
19 {{- if and .Values.rbac.create .Values.serviceAccount.create }}
20       serviceAccountName: {{ template "prometheus-node-exporter.serviceAccountName" . }}
21 {{- end }}
22 {{- if .Values.securityContext }}
23       securityContext:
24 {{ toYaml .Values.securityContext | indent 8 }}
25 {{- end }}
26 {{- if .Values.priorityClassName }}
27       priorityClassName: {{ .Values.priorityClassName }}
28 {{- end }}
29       containers:
30         - name: node-exporter
31           image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
32           imagePullPolicy: {{ .Values.image.pullPolicy }}
33           args:
34             - --path.procfs=/host/proc
35             - --path.sysfs=/host/sys
36             - --web.listen-address=0.0.0.0:{{ .Values.service.port }}
37 {{- if .Values.extraArgs }}
38 {{ toYaml .Values.extraArgs | indent 12 }}
39 {{- end }}
40           ports:
41             - name: metrics
42               containerPort: {{ .Values.service.targetPort }}
43               protocol: TCP
44           livenessProbe:
45             httpGet:
46               path: /
47               port: {{ .Values.service.port }}
48           readinessProbe:
49             httpGet:
50               path: /
51               port: {{ .Values.service.port }}
52           resources:
53 {{ toYaml .Values.resources | indent 12 }}
54           volumeMounts:
55             - name: proc
56               mountPath: /host/proc
57               readOnly:  true
58             - name: sys
59               mountPath: /host/sys
60               readOnly: true
61             {{- if .Values.extraHostVolumeMounts }}
62             {{- range $_, $mount := .Values.extraHostVolumeMounts }}
63             - name: {{ $mount.name }}
64               mountPath: {{ $mount.mountPath }}
65               readOnly: {{ $mount.readOnly }}
66             {{- if $mount.mountPropagation }}
67               mountPropagation: {{ $mount.mountPropagation }}
68             {{- end }}
69             {{- end }}
70             {{- end }}
71       hostNetwork: true
72       hostPID: true
73 {{- if .Values.affinity }}
74       affinity:
75 {{ toYaml .Values.affinity | indent 8 }}
76 {{- end }}
77 {{- if .Values.nodeSelector }}
78       nodeSelector:
79 {{ toYaml .Values.nodeSelector | indent 8 }}
80 {{- end }}
81     {{- with .Values.tolerations }}
82       tolerations:
83 {{ toYaml . | indent 8 }}
84     {{- end }}
85       volumes:
86         - name: proc
87           hostPath:
88             path: /proc
89         - name: sys
90           hostPath:
91             path: /sys
92         {{- if .Values.extraHostVolumeMounts }}
93         {{- range $_, $mount := .Values.extraHostVolumeMounts }}
94         - name: {{ $mount.name }}
95           hostPath:
96             path: {{ $mount.hostPath }}
97         {{- end }}
98         {{- end }}