-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprometheus_k8s_deployments.yaml
68 lines (68 loc) · 1.66 KB
/
prometheus_k8s_deployments.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: pm-lab
namespace: prometheus-lab
labels:
app: pm-lab
spec:
selector:
matchLabels:
app: pm-lab
replicas: 2
template:
metadata:
labels:
app: pm-lab
spec:
# k8s Node Selector
nodeSelector:
app: prometheus
# Ex Hosts
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "pm.example.com"
containers:
- name: prometheus
args:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/prometheus/consoles
- --storage.tsdb.retention=14d
- --storage.tsdb.retention.time=14d
- --storage.tsdb.retention.size=10GB
command:
- /bin/prometheus
image: prom/prometheus
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9090
name: console
protocol: TCP
# Limite
resources:
limits:
memory: "2G"
cpu: "2"
securityContext:
capabilities: {}
procMount: Default
runAsUser: 0
# Volume
volumeMounts:
- name: pm-conf
mountPath: /etc/prometheus/prometheus.yml
readOnly: true
subPath: prometheus.yml
- name: pm-storage
mountPath: "/prometheus"
# Mount
volumes:
- name: pm-conf
configMap:
name: pm-lab-config
- name: pm-storage
persistentVolumeClaim:
claimName: pm-lab-data-claim