From 1e035afc2c65ac244392726827e1c18d6b2d7ff6 Mon Sep 17 00:00:00 2001 From: Nishant Kumar Date: Fri, 14 Feb 2020 17:07:30 +0000 Subject: [PATCH] Robust maas-rack readiness probe With the existing readiness probe mechanism, if log rotation occurs then it may lead maas rack pod to show false not ready. Instead save the success message of rack registration to a file and then use it in the readiness probe. Change-Id: I569b99186d398db44a10824dc3fe8c745b13a4ac --- charts/maas/templates/bin/_register-rack-controller.sh.tpl | 1 + charts/maas/templates/statefulset-rack.yaml | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/maas/templates/bin/_register-rack-controller.sh.tpl b/charts/maas/templates/bin/_register-rack-controller.sh.tpl index 2aaa6bd..bfa9937 100644 --- a/charts/maas/templates/bin/_register-rack-controller.sh.tpl +++ b/charts/maas/templates/bin/_register-rack-controller.sh.tpl @@ -20,6 +20,7 @@ register_maas_rack() { if maas-rack register --url="${MAAS_ENDPOINT}" --secret="${MAAS_REGION_SECRET}"; then echo "Successfully registered with MaaS Region Controller" + touch '/tmp/maas-rack.done' break else echo "Unable to register with ${MAAS_ENDPOINT}... will try again" diff --git a/charts/maas/templates/statefulset-rack.yaml b/charts/maas/templates/statefulset-rack.yaml index 581804e..e91bd86 100644 --- a/charts/maas/templates/statefulset-rack.yaml +++ b/charts/maas/templates/statefulset-rack.yaml @@ -99,9 +99,8 @@ spec: timeoutSeconds: 60 exec: command: - - /bin/bash - - -c - - journalctl -u register-rack-controller -n 5 | grep -q 'Successfully registered with MaaS Region Controller' + - ls + - /tmp/maas-rack.done volumeMounts: - mountPath: /sys/fs/cgroup name: host-sys-fs-cgroup