-
Notifications
You must be signed in to change notification settings - Fork 113
/
node-disk-manager.yaml
117 lines (117 loc) · 4.04 KB
/
node-disk-manager.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
114
115
116
117
# Create NDM daemonset
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-disk-manager
namespace: openebs
spec:
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
name: node-disk-manager
template:
metadata:
labels:
name: node-disk-manager
spec:
# By default the node-disk-manager will be run on all kubernetes nodes
# If you would like to limit this to only some nodes, say the nodes
# that have storage attached, you could label those node and use nodeSelector.
# Example: Label the storage nodes with - "openebs.io/nodegroup"="storage-node"
# kubectl label node <node-name> "openebs.io/nodegroup"="storage-node"
# nodeSelector:
# "openebs.io/nodegroup": "storage-node"
# Use host network as container network to monitor udev source using netlink
# to detect disk attach and detach events using fd.
hostNetwork: true
hostPID: true
serviceAccountName: openebs-maya-operator
containers:
- name: node-disk-manager
image: openebs/node-disk-manager:ci
args:
- -v=4
- --feature-gates="GPTBasedUUID"
# Use partition table UUID instead of create single partition to get
# partition UUID. Require `GPTBasedUUID` to be enabled with.
# - --feature-gates="PartitionTableUUID"
- --feature-gates="APIService"
# Detect changes to device size, filesystem and mount-points without restart.
#- --feature-gates="ChangeDetection"
# Default address is 0.0.0.0:9115, do not use quotes around the address
# - --api-service-address=0.0.0.0:9115
- --feature-gates="UseOSDisk"
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
volumeMounts:
- name: config
mountPath: /host/node-disk-manager.config
subPath: node-disk-manager.config
readOnly: true
# make udev database available inside container
- name: udev
mountPath: /run/udev
- name: procmount
mountPath: /host/proc
readOnly: true
- name: devmount
mountPath: /dev
- name: basepath
mountPath: /var/openebs/ndm
- name: sparsepath
mountPath: /var/openebs/sparse
env:
# namespace in which NDM is installed will be passed to NDM Daemonset
# as environment variable
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# pass hostname as env variable using downward API to the NDM container
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
# specify the directory where the sparse files need to be created.
# if not specified, then sparse files will not be created.
- name: SPARSE_FILE_DIR
value: "/var/openebs/sparse"
# Size of the sparse file to be created.
- name: SPARSE_FILE_SIZE
value: "1073741824"
# Specify the number of sparse files to be created
- name: SPARSE_FILE_COUNT
value: "0"
# Set the core dump env to enable core dump for NDM daemon
#- name: ENABLE_COREDUMP
# value: "1"
volumes:
- name: config
configMap:
name: node-disk-manager-config
- name: udev
hostPath:
path: /run/udev
type: Directory
- name: procmount
# mount /proc/1/mounts (mount file of process 1 of host) inside container
# to read which partition is mounted on / path
hostPath:
path: /proc
type: Directory
- name: devmount
# the /dev directory is mounted so that we have access to the devices that
# are connected at runtime of the pod.
hostPath:
path: /dev
type: Directory
- name: basepath
hostPath:
path: /var/openebs/ndm
type: DirectoryOrCreate
- name: sparsepath
hostPath:
path: /var/openebs/sparse
---