This repository is currently being migrated. It's locked while the migration is in progress.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdaemonset.yaml
113 lines (107 loc) · 2.37 KB
/
daemonset.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
107
108
109
110
111
112
113
# ServiceAccount for DaemonSet.
apiVersion: v1
kind: ServiceAccount
metadata:
name: storageos-daemonset-sa
namespace: default
---
# ClusterRole for init container.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: init-container
rules:
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- get
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- get
- list
- delete
---
# Bind DaemonSet ServiceAccount with init-container ClusterRole.
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: init-container
subjects:
- kind: ServiceAccount
name: storageos-daemonset-sa
namespace: default
roleRef:
kind: ClusterRole
name: init-container
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: storageos-daemonset
labels:
app: storageos-daemonset
spec:
selector:
matchLabels:
name: storageos-daemonset
template:
metadata:
labels:
name: storageos-daemonset
spec:
serviceAccountName: storageos-daemonset-sa
initContainers:
- name: storageos-init
image: storageos/init:test
env:
- name: DAEMONSET_NAME
value: storageos-daemonset
- name: DAEMONSET_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MINIMUM_MAX_PIDS_LIMIT
value: "1024"
- name: RECOMMENDED_MAX_PIDS_LIMIT
value: "4096"
volumeMounts:
- name: kernel-modules
mountPath: /lib/modules
readOnly: true
- name: sys
mountPath: /sys
mountPropagation: Bidirectional
- name: state
mountPath: /var/lib/storageos
mountPropagation: Bidirectional
securityContext:
privileged: true
capabilities:
add:
- SYS_ADMIN
containers:
- name: storageos
image: busybox
imagePullPolicy: IfNotPresent
args:
- sleep
- "600"
volumes:
- name: kernel-modules
hostPath:
path: /lib/modules
- name: sys
hostPath:
path: /sys
- name: state
hostPath:
path: /var/lib/storageos
updateStrategy:
type: OnDelete