-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprometheus-statefulset.yaml
More file actions
84 lines (84 loc) · 3.03 KB
/
Copy pathprometheus-statefulset.yaml
File metadata and controls
84 lines (84 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "plg.prometheus.fullname" . }}
labels:
{{- include "plg.prometheus.labels" . | nindent 4 }}
spec:
replicas: 1
serviceName: {{ include "plg.prometheus.fullname" . }}
selector:
matchLabels:
{{- include "plg.prometheus.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "plg.prometheus.labels" . | nindent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/prometheus-configmap.yaml") . | sha256sum }}
checksum/rules: {{ include (print $.Template.BasePath "/prometheus-rules-configmap.yaml") . | sha256sum }}
checksum/alertmanager-config: {{ include (print $.Template.BasePath "/alertmanager-configmap.yaml") . | sha256sum }}
spec:
serviceAccountName: {{ include "plg.prometheus.fullname" . }}
containers:
- name: prometheus
image: "{{ .Values.prometheus.image.repository }}:{{ .Values.prometheus.image.tag }}"
imagePullPolicy: {{ .Values.prometheus.image.pullPolicy }}
args:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time={{ .Values.prometheus.retentionDays }}d
- --web.console.libraries=/etc/prometheus/console_libraries
- --web.console.templates=/etc/prometheus/consoles
- --web.enable-lifecycle
ports:
- name: http
containerPort: {{ .Values.prometheus.httpPort }}
protocol: TCP
readinessProbe:
httpGet:
path: /-/ready
port: http
initialDelaySeconds: 15
periodSeconds: 10
livenessProbe:
httpGet:
path: /-/healthy
port: http
initialDelaySeconds: 30
periodSeconds: 15
resources:
{{- toYaml .Values.prometheus.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /etc/prometheus
- name: rules
mountPath: /etc/prometheus/rules
readOnly: true
- name: data
mountPath: /prometheus
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
runAsNonRoot: true
volumes:
- name: config
configMap:
name: {{ include "plg.prometheus.fullname" . }}-config
- name: rules
configMap:
name: {{ include "plg.prometheus.fullname" . }}-rules
volumeClaimTemplates:
- metadata:
name: data
labels:
{{- include "plg.prometheus.selectorLabels" . | nindent 10 }}
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.prometheus.storageClassName }}
storageClassName: {{ .Values.prometheus.storageClassName }}
{{- end }}
resources:
requests:
storage: {{ .Values.prometheus.pvcSize }}