Skip to content
This repository was archived by the owner on Jul 7, 2020. It is now read-only.

Commit 20f39c4

Browse files
nixpanicjarrpa
authored andcommitted
deploy: provide an alternative volume mount for /dev
The gluster-setup.sh script in the glusterfs-server container now chceks for the HOST_DEV_DIR environment variable and will 'mount --rbind' the alternative path to /dev from the host to /dev in the container. This is needed to allow access to *all* devices on the host, including ones that get dynamically allocated or hot-plugged. See-also: gluster/gluster-containers#115 Signed-off-by: Niels de Vos <ndevos@redhat.com>
1 parent 4702a03 commit 20f39c4

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

deploy/kube-templates/glusterfs-daemonset.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ spec:
2424
imagePullPolicy: IfNotPresent
2525
name: glusterfs
2626
env:
27+
# alternative for /dev volumeMount to enable access to *all* devices
28+
- name: HOST_DEV_DIR
29+
value: "/mnt/host-dev"
2730
# set GLUSTER_BLOCKD_STATUS_PROBE_ENABLE to "1" so the
2831
# readiness/liveness probe validate gluster-blockd as well
2932
- name: GLUSTER_BLOCKD_STATUS_PROBE_ENABLE
@@ -49,10 +52,8 @@ spec:
4952
mountPath: "/var/log/glusterfs"
5053
- name: glusterfs-config
5154
mountPath: "/var/lib/glusterd"
52-
- name: glusterfs-dev-disk
53-
mountPath: "/dev/disk"
54-
- name: glusterfs-dev-mapper
55-
mountPath: "/dev/mapper"
55+
- name: glusterfs-host-dev
56+
mountPath: "/mnt/host-dev"
5657
- name: glusterfs-misc
5758
mountPath: "/var/lib/misc/glusterfsd"
5859
- name: glusterfs-cgroup
@@ -106,12 +107,9 @@ spec:
106107
- name: glusterfs-config
107108
hostPath:
108109
path: "/var/lib/glusterd"
109-
- name: glusterfs-dev-disk
110+
- name: glusterfs-host-dev
110111
hostPath:
111-
path: "/dev/disk"
112-
- name: glusterfs-dev-mapper
113-
hostPath:
114-
path: "/dev/mapper"
112+
path: "/dev"
115113
- name: glusterfs-misc
116114
hostPath:
117115
path: "/var/lib/misc/glusterfsd"

deploy/ocp-templates/glusterfs-template.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ objects:
3737
imagePullPolicy: IfNotPresent
3838
name: glusterfs
3939
env:
40+
- name: HOST_DEV_DIR
41+
value: "${HOST_DEV_DIR}"
4042
- name: GLUSTER_BLOCKD_STATUS_PROBE_ENABLE
4143
value: "${GLUSTER_BLOCKD_STATUS_PROBE_ENABLE}"
4244
- name: GB_GLFS_LRU_COUNT
@@ -60,10 +62,8 @@ objects:
6062
mountPath: "/var/log/glusterfs"
6163
- name: glusterfs-config
6264
mountPath: "/var/lib/glusterd"
63-
- name: glusterfs-dev-disk
64-
mountPath: "/dev/disk"
65-
- name: glusterfs-dev-mapper
66-
mountPath: "/dev/mapper"
65+
- name: glusterfs-host-dev
66+
mountPath: "${HOST_DEV_DIR}"
6767
- name: glusterfs-misc
6868
mountPath: "/var/lib/misc/glusterfsd"
6969
- name: glusterfs-cgroup
@@ -100,7 +100,7 @@ objects:
100100
periodSeconds: 25
101101
successThreshold: 1
102102
failureThreshold: 50
103-
terminationMessagePath: "/dev/termination-log"
103+
terminationMessagePath: "/var/log/termination.log"
104104
volumes:
105105
- name: glusterfs-heketi
106106
hostPath:
@@ -119,12 +119,9 @@ objects:
119119
- name: glusterfs-config
120120
hostPath:
121121
path: "/var/lib/glusterd"
122-
- name: glusterfs-dev-disk
122+
- name: glusterfs-host-dev
123123
hostPath:
124-
path: "/dev/disk"
125-
- name: glusterfs-dev-mapper
126-
hostPath:
127-
path: "/dev/mapper"
124+
path: "/dev"
128125
- name: glusterfs-misc
129126
hostPath:
130127
path: "/var/lib/misc/glusterfsd"
@@ -161,3 +158,8 @@ parameters:
161158
description: This value is to set tcmu runner log directory
162159
value: "/var/log/glusterfs/gluster-block"
163160
required: true
161+
- name: HOST_DEV_DIR
162+
displayName: Alternative path to /dev in the container
163+
description: Volume mount point of /dev from the host so that the container can access all devices.
164+
value: "/mnt/host-dev"
165+
required: true

0 commit comments

Comments
 (0)