-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprometheus.yaml
91 lines (90 loc) · 2.2 KB
/
prometheus.yaml
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
85
86
87
88
89
90
91
kind: Service
apiVersion: v1
metadata:
name: prometheus-ch3-01
spec:
selector:
app: prometheus-ch3-01
ports:
- protocol: TCP
port: 9090
targetPort: 9090
type: ClusterIP
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: prometheus-ch3-01
labels:
app: prometheus-ch3-01
spec:
replicas: 1
selector:
matchLabels:
app: prometheus-ch3-01
template:
metadata:
labels:
app: prometheus-ch3-01
spec:
hostNetwork: false
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- <<host>>
containers:
- name: prometheus-ch3-01
image: <<registry>
volumeMounts:
- mountPath: /etc/prometheus
name: prometheus-ch3-01
readOnly: true
- mountPath: /etc/certs
name: certs
readOnly: true
- mountPath: /prometheus
name: data
readOnly: false
securityContext:
privileged: false
capabilities:
drop:
- CHOWN
- DAC_OVERRIDE
- FOWNER
- FSETID
- SETUID
- SETGID
- SYS_CHROOT
- MKNOD
args:
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention=30d
- --config.file=/etc/prometheus/prometheus-ch3-01-config.yaml
# - --web.external-url=https://<<host>>/prometheus-ch3-01
# - --web.route-prefix=/prometheus-ch3-01
- --log.level=debug
ports:
- containerPort: 9090
volumes:
- hostPath:
path: /mnt/configs/prometheus-ch3-01
type: Directory
name: prometheus-ch3-01
- hostPath:
path: /mnt/configs/certs
type: Directory
name: certs
- hostPath:
path: /mnt/prometheus/prometheus-ch3-01-data
type: Directory
name: data
dnsPolicy: Default
imagePullSecrets:
- name: regsecret