From 67c905cae8aa4dd7d4688fdbd311f28080d96980 Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Wed, 23 Sep 2020 10:38:32 -0500 Subject: [PATCH] [ceph-osd] wait for only osd pods from post apply job This is to wait only for osd pods during ceph-osd chart install/upgrade process. Change-Id: I99bc7c1548f7b13c93059ac832b9f0589b049fc7 --- ceph-osd/Chart.yaml | 2 +- ceph-osd/templates/bin/_post-apply.sh.tpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ceph-osd/Chart.yaml b/ceph-osd/Chart.yaml index 286be9844..8bd6e093f 100644 --- a/ceph-osd/Chart.yaml +++ b/ceph-osd/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph OSD name: ceph-osd -version: 0.1.1 +version: 0.1.2 home: https://github.com/ceph/ceph ... diff --git a/ceph-osd/templates/bin/_post-apply.sh.tpl b/ceph-osd/templates/bin/_post-apply.sh.tpl index fb798cc71..86ace691e 100644 --- a/ceph-osd/templates/bin/_post-apply.sh.tpl +++ b/ceph-osd/templates/bin/_post-apply.sh.tpl @@ -48,7 +48,7 @@ function wait_for_pods() { min_osds="add | if .true >= (.false + .true)*${REQUIRED_PERCENT_OF_OSDS}/100 \ then \"pass\" else \"fail\" end" while true; do - unhealthy_pods=$(kubectl get pods --namespace="${1}" -o json | jq -c "${query}") + unhealthy_pods=$(kubectl get pods --namespace="${1}" -o json -l component=osd| jq -c "${query}") if [[ -z "${unhealthy_pods}" ]]; then break fi @@ -56,7 +56,7 @@ function wait_for_pods() { if [ $(date -u +%s) -gt $end ] ; then echo -e "Containers failed to start after $timeout seconds\n" - kubectl get pods --namespace "${1}" -o wide + kubectl get pods --namespace "${1}" -o wide -l component=osd # Leaving while loop if minimum amount of OSDs are ready. # It allows to proceed even if some OSDs are not ready # or in "CrashLoopBackOff" state