Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CentOS/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ systemctl disable nfs-server.service && \
systemctl mask getty.target && \
systemctl enable gluster-fake-disk.service && \
systemctl enable gluster-setup.service && \
systemctl enable gluster-block-setup.service && \
systemctl enable gluster-blockd.service && \
systemctl enable glusterd.service && \
systemctl enable gluster-check-diskspace.service

Expand Down
15 changes: 15 additions & 0 deletions CentOS/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
This dockerfile can be used to build a CentOS Gluster Container.

# Readiness and liveness probes

The container contains a script at `/usr/local/bin/status-probe.sh` that can be
used to check the status of the services. The script can be called with
`readiness` or `liveness` as argument.

# Enabling/Disabling gluster-block

Gluster Block is an optional service that can be used to provide
PersistentVolumes of type=Block. Not everyone needs this functionality, and on
some distributions the dependencies (in the kernel) might be missing. It is
possible to disable the Gluster Block service by exporting the
`GLUSTER_BLOCK_ENABLED` environment variable set to `"0"`. By default the
environment variable will be set to `"1"` so that the service is enabled.

# Support for fake disks

This container offers several configuration options that make it easier to test
Expand Down
7 changes: 5 additions & 2 deletions CentOS/status-probe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Return overall status of the glusterfs container
#

: ${GLUSTER_BLOCK_ENABLED:=1}
: ${GLUSTER_BLOCKD_STATUS_PROBE_ENABLE:=1}

require() {
if ! "$@" ; then
echo "failed check: $*" >&2
Expand Down Expand Up @@ -32,8 +35,8 @@ case "$mode" in
echo "warning: no mode provided. Assuming liveness probe" >&2
fi
require systemctl -q is-active glusterd.service
if [[ "$GLUSTER_BLOCKD_STATUS_PROBE_ENABLE" -eq 1 ]]; then

if [[ "$GLUSTER_BLOCK_ENABLED" -ne 0 ]] && [[ "$GLUSTER_BLOCKD_STATUS_PROBE_ENABLE" -eq 1 ]]; then
require systemctl -q is-active gluster-blockd.service
fi

Expand Down
24 changes: 17 additions & 7 deletions CentOS/update-params.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,27 @@
: ${GB_LOGDIR:=/var/log/glusterfs/gluster-block}
: ${TCMU_LOGDIR:=/var/log/glusterfs/gluster-block}
: ${GB_GLFS_LRU_COUNT:=15}
: ${GLUSTER_BLOCK_ENABLED:=1}
: ${HOST_DEV_DIR:=/mnt/host-dev}

echo "env variable is set. Update in gluster-blockd.service"
#FIXME To update in environment file
sed -i '/GB_GLFS_LRU_COUNT=/s/GB_GLFS_LRU_COUNT=.*/'GB_GLFS_LRU_COUNT="$GB_GLFS_LRU_COUNT"\"'/' /usr/lib/systemd/system/gluster-blockd.service
sed -i '/EnvironmentFile/i Environment="GB_LOGDIR='$GB_LOGDIR'"' /usr/lib/systemd/system/gluster-blockd.service
if [ "$GLUSTER_BLOCK_ENABLED" == 1 ]; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, 1 is numeric value => eq is better.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

< This change was recently reverted with commit f5409d9. With a small correction to the change, this should now function as expected. The status-probe.sh script checks the value for GLUSTER_BLOCK_ENABLED and compares it to 1. However the update-params.sh script set the variable by default to TRUE. gluster-kubernetes and openshift-ansible both set the variable to "1" by default, so should update-params.sh.

This needs an update too

echo "Enabling gluster-block service and updating env. variables"
systemctl enable gluster-block-setup.service
systemctl enable gluster-blockd.service

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the actual issue mentioned here issue #120 resolved here? Please reboot the node and see whether this specific line executes fine.


sed -i "s#TCMU_LOGDIR=.*#TCMU_LOGDIR='$TCMU_LOGDIR'#g" /etc/sysconfig/tcmu-runner-params
#FIXME To update in environment file
sed -i '/GB_GLFS_LRU_COUNT=/s/GB_GLFS_LRU_COUNT=.*/'GB_GLFS_LRU_COUNT="$GB_GLFS_LRU_COUNT"\"'/' /usr/lib/systemd/system/gluster-blockd.service
sed -i '/EnvironmentFile/i Environment="GB_LOGDIR='$GB_LOGDIR'"' /usr/lib/systemd/system/gluster-blockd.service

sed -i '/ExecStart/i EnvironmentFile=-/etc/sysconfig/tcmu-runner-params' /usr/lib/systemd/system/tcmu-runner.service
sed -i '/tcmu-log-dir=/s/tcmu-log-dir.*/tcmu-log-dir $TCMU_LOGDIR/' /usr/lib/systemd/system/tcmu-runner.service
sed -i "s#TCMU_LOGDIR=.*#TCMU_LOGDIR='$TCMU_LOGDIR'#g" /etc/sysconfig/tcmu-runner-params

sed -i '/ExecStart/i EnvironmentFile=-/etc/sysconfig/tcmu-runner-params' /usr/lib/systemd/system/tcmu-runner.service
sed -i '/tcmu-log-dir=/s/tcmu-log-dir.*/tcmu-log-dir $TCMU_LOGDIR/' /usr/lib/systemd/system/tcmu-runner.service
else
echo "Disabling gluster-block service"
systemctl disable gluster-block-setup.service
systemctl disable gluster-blockd.service
fi

if [ -c "${HOST_DEV_DIR}/zero" ] && [ -c "${HOST_DEV_DIR}/null" ]; then
# looks like an alternate "host dev" has been provided
Expand Down