-
Notifications
You must be signed in to change notification settings - Fork 6
/
sample.yaml
94 lines (94 loc) · 2.38 KB
/
sample.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
apiVersion: v1
kind: Namespace
metadata:
name: kcdt
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: coredump-admin
namespace: kcdt
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: coredump-event-reporter
rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: coredump-event-report
subjects:
- kind: ServiceAccount
name: coredump-admin
namespace: kcdt
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: coredump-event-reporter
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kcdt-ds
namespace: kcdt
spec:
selector:
matchLabels:
name: kcdt
template:
metadata:
labels:
name: kcdt
spec:
containers:
- name: kcdt-container
image: fenggw/kcdt:latest
securityContext:
privileged: true
volumeMounts:
- name: tz-config
mountPath: /etc/localtime
- name: host-volume
mountPath: /kcdt/host
mountPropagation: Bidirectional
- name: coredump-backend
mountPath: /kcdt/host/core
env:
# This value must be the same with the path of
# "host-volume", see below comments for details.
- name: HOSTVOL
value: /root
# NS_DISK_QUOTA sets the coredump disk quota
# for every k8s namespace, this is optional,
# default value is 1 GB.
- name: NS_DISK_QUOTA
value: "100mb"
command: ["/kcdt/init.sh"]
lifecycle:
preStop:
exec:
command: ["/kcdt/cleanup.sh"]
serviceAccountName: coredump-admin
volumes:
- name: tz-config
hostPath:
# Change the path to the timezone of your host.
path: /usr/share/zoneinfo/Asia/Shanghai
- name: host-volume
hostPath:
# The coredump handler program and related files will
# be installed here, you can config it as you like,
# but remember to modify the args value of HOSTVOL in
# env above as well.
path: /root
- name: coredump-backend
# The coredump files will be stored here, please config
# your own storage backend here with nfs or ceph etc..
nfs:
server: $YOUR-SERVER-IP
path: $YOUR-PATH