-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwatcher.yaml
106 lines (106 loc) · 2.2 KB
/
watcher.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: git2kube-watcher
namespace: config
labels:
app: git2kube-watcher
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: git2kube-watcher
labels:
app: git2kube-watcher
rules:
- apiGroups:
- ""
resources:
- namespaces
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- update
- patch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: git2kube-watcher
labels:
app: git2kube-watcher
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: git2kube-watcher
subjects:
- kind: ServiceAccount
name: git2kube-watcher
namespace: config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: git2kube-watcher
namespace: config
labels:
app: git2kube-watcher
spec:
replicas: 1
selector:
matchLabels:
app: git2kube-watcher
template:
metadata:
labels:
app: git2kube-watcher
spec:
serviceAccountName: git2kube-watcher
containers:
- name: git2kube-prometheus-rules
image: ghcr.io/wandera/git2kube
args:
- 'watch'
- 'configmap'
- '--configmap=alert-rules'
- '--namespace=monitoring'
- '--healthcheck-file=/tmp/health'
- '--branch=master'
- '--git=https://github.com/prometheus/mysqld_exporter.git'
- '--include=.*\.rules'
- '--interval=30'
- '--label=prometheus=k8s'
- '--label=role=alert-rules'
livenessProbe:
exec:
command:
- /bin/sh
- -c
- "grep -Fxq OK /tmp/health"
initialDelaySeconds: 10
periodSeconds: 35
failureThreshold: 3
readinessProbe:
exec:
command:
- /bin/sh
- -c
- "grep -Fxq OK /tmp/health"
initialDelaySeconds: 10
periodSeconds: 10
resources:
requests:
cpu: 100m
memory: 32Mi
limits:
cpu: 200m
memory: 64Mi