010c3978a1
This PS tidies the Ceph scripts. In addition, it allows the chart to be removed and re-deployed without data loss, and improves robustness to rebooting nodes and/or the cluster. Change-Id: If5a65d0dcca1d049b177d9bffb654a13d56c3823
15 lines
306 B
Smarty
15 lines
306 B
Smarty
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
NUMBER_OF_MONS=$(ceph mon stat | awk '$3 == "mons" {print $2}')
|
|
if [ "${NUMBER_OF_MONS}" -gt "1" ]; then
|
|
if [[ ${K8S_HOST_NETWORK} -eq 0 ]]; then
|
|
ceph mon remove "${POD_NAME}"
|
|
else
|
|
ceph mon remove "${NODE_NAME}"
|
|
fi
|
|
else
|
|
echo "we are the last mon, not removing"
|
|
fi
|