From 13fd81b8d98359099b2cb099f3ae4fb43945c12f Mon Sep 17 00:00:00 2001 From: Stephen Taylor Date: Mon, 13 Jun 2022 10:52:05 -0600 Subject: [PATCH] [ceph-mon] Allow for unconditional mon restart This change allows mons to be restarted unconditionally by the ceph-mon chart. This can be useful in upgrade scenarios where ceph-mon pods need to be forcibly restarted for any reason. Change-Id: I93a1426c2ca02b060f7a606495893feb2813c142 --- ceph-mon/Chart.yaml | 2 +- ceph-mon/templates/bin/_post-apply.sh.tpl | 4 ++-- ceph-mon/templates/job-post-apply.yaml | 2 ++ ceph-mon/values.yaml | 5 +++++ releasenotes/notes/ceph-mon.yaml | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ceph-mon/Chart.yaml b/ceph-mon/Chart.yaml index f648967b3..a5db488c7 100644 --- a/ceph-mon/Chart.yaml +++ b/ceph-mon/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph Mon name: ceph-mon -version: 0.1.24 +version: 0.1.25 home: https://github.com/ceph/ceph ... diff --git a/ceph-mon/templates/bin/_post-apply.sh.tpl b/ceph-mon/templates/bin/_post-apply.sh.tpl index 93412ed4c..6659c6f6f 100644 --- a/ceph-mon/templates/bin/_post-apply.sh.tpl +++ b/ceph-mon/templates/bin/_post-apply.sh.tpl @@ -118,8 +118,8 @@ done echo "Latest revision of the helm chart(s) is : $max_release" -if [[ $max_release -gt 1 ]]; then - if [[ $require_upgrade -gt 0 ]]; then +if [[ "$UNCONDITIONAL_MON_RESTART" == "true" ]] || [[ $max_release -gt 1 ]]; then + if [[ "$UNCONDITIONAL_MON_RESTART" == "true" ]] || [[ $require_upgrade -gt 0 ]]; then echo "Restart ceph-mon pods one at a time to prevent disruption" restart_mons fi diff --git a/ceph-mon/templates/job-post-apply.yaml b/ceph-mon/templates/job-post-apply.yaml index 01a1b1f7f..0b924cc42 100644 --- a/ceph-mon/templates/job-post-apply.yaml +++ b/ceph-mon/templates/job-post-apply.yaml @@ -100,6 +100,8 @@ spec: value: {{ .Release.Namespace }} - name: RELEASE_GROUP_NAME value: {{ .Release.Name }} + - name: UNCONDITIONAL_MON_RESTART + value: {{ .Values.conf.storage.unconditional_mon_restart | quote }} command: - /tmp/post-apply.sh volumeMounts: diff --git a/ceph-mon/values.yaml b/ceph-mon/values.yaml index e79653998..25543887c 100644 --- a/ceph-mon/values.yaml +++ b/ceph-mon/values.yaml @@ -296,6 +296,11 @@ conf: mon: directory: /var/lib/openstack-helm/ceph/mon + # The post-apply job will try to determine if mons need to be restarted + # and only restart them if necessary. Set this value to "true" to restart + # mons unconditionally. + unconditional_mon_restart: "false" + daemonset: prefix_name: "mon" diff --git a/releasenotes/notes/ceph-mon.yaml b/releasenotes/notes/ceph-mon.yaml index 7df7f5855..1a3668960 100644 --- a/releasenotes/notes/ceph-mon.yaml +++ b/releasenotes/notes/ceph-mon.yaml @@ -25,4 +25,5 @@ ceph-mon: - 0.1.22 Correct configmap names for all resources - 0.1.23 Release-specific ceph-template configmap name - 0.1.24 Prevents mgr SA from repeated creation + - 0.1.25 Allow for unconditional mon restart ...