forked from kuberhealthy/kuberhealthy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpod-restarts-check.yaml
78 lines (77 loc) · 1.65 KB
/
pod-restarts-check.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
apiVersion: comcast.github.io/v1
kind: KuberhealthyCheck
metadata:
name: pod-restarts
namespace: kuberhealthy
spec:
runInterval: 5m
timeout: 10m
podSpec:
securityContext:
runAsUser: 999
fsGroup: 999
containers:
- env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MAX_FAILURES_ALLOWED
value: "10"
image: kuberhealthy/pod-restarts-check:v2.5.1
imagePullPolicy: IfNotPresent
name: main
resources:
requests:
cpu: 10m
memory: 50Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
restartPolicy: Never
serviceAccountName: pod-restart-sa
---
# Source: kuberhealthy/templates/khcheck-pod-restarts.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-restart-sa
namespace: kuberhealthy
---
# Source: kuberhealthy/templates/khcheck-pod-restarts.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pod-restart-role
namespace: kuberhealthy
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- list
---
# Source: kuberhealthy/templates/khcheck-pod-restarts.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: pod-restart-rb
namespace: kuberhealthy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pod-restart-role
subjects:
- kind: ServiceAccount
name: pod-restart-sa