[ceph] Fix for ceph-osd pods restart

This PS updates ceph-osd pod containers making
sure that osd pods are not stuck at deletion. In
this PS we are taking care of another background
process that has to be terminated by preStop
script.

Change-Id: Icebb6119225b4b88fb213932cc3bcf78d650848f
This commit is contained in:
Sergiy Markin 2024-12-12 00:52:33 +00:00
parent c98ea9ca61
commit 2b500465da
4 changed files with 12 additions and 2 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph OSD description: OpenStack-Helm Ceph OSD
name: ceph-osd name: ceph-osd
version: 0.1.56 version: 0.1.57
home: https://github.com/ceph/ceph home: https://github.com/ceph/ceph
... ...

View File

@ -26,3 +26,10 @@ do
kill -9 ${TAIL_PID}; kill -9 ${TAIL_PID};
sleep 1; sleep 1;
done done
SLEEP_PID="$(cat /tmp/ceph-log-runner-sleep.pid)"
while kill -0 ${SLEEP_PID} >/dev/null 2>&1;
do
kill -9 ${SLEEP_PID};
sleep 1;
done

View File

@ -25,7 +25,7 @@ function tail_file () {
while $keep_running; do while $keep_running; do
tail --retry -f "${log_file}" & tail --retry -f "${log_file}" &
tail_pid=$! tail_pid=$!
echo $tail_pid > /tmp/ceph-log-runner.pid echo $tail_pid > /tmp/ceph-log-runner-tail.pid
wait $tail_pid wait $tail_pid
if [ -f /tmp/ceph-log-runner.stop ]; then if [ -f /tmp/ceph-log-runner.stop ]; then
keep_running=false keep_running=false
@ -37,6 +37,8 @@ function tail_file () {
function truncate_log () { function truncate_log () {
while $keep_running; do while $keep_running; do
sleep ${TRUNCATE_PERIOD} sleep ${TRUNCATE_PERIOD}
sleep_pid=$!
echo $sleep_pid > /tmp/ceph-log-runner-sleep.pid
if [[ -f ${log_file} ]] ; then if [[ -f ${log_file} ]] ; then
truncate -s "${TRUNCATE_SIZE}" "${log_file}" truncate -s "${TRUNCATE_SIZE}" "${log_file}"
fi fi

View File

@ -57,4 +57,5 @@ ceph-osd:
- 0.1.54 Remove use of tini for ceph-daemon - 0.1.54 Remove use of tini for ceph-daemon
- 0.1.55 Update ceph-osd pod containers to make sure OSD pods are properly terminated at restart - 0.1.55 Update ceph-osd pod containers to make sure OSD pods are properly terminated at restart
- 0.1.56 Add preStop lifecycle script to log-runner - 0.1.56 Add preStop lifecycle script to log-runner
- 0.1.57 Added code to kill another background process in log-runner at restart
... ...