Extend timeout for the kubectl cmds in dbmon

In AIO-DX, during the swact, dbmon experiences kubectl commands
respond slower than expected. dbmon reports error while the kubectl
commands not responding within 5 seconds, the 5 seconds timeout is too
short.

Extend the timeout to 10 seconds, to avoid reporting unnecessary error.

Change-Id: Ie07c84e0a53c00ac78970bf6b06e6cf0b19479e1
Closes-Bug: 1837919
Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
Bin Qian 2019-09-05 15:32:39 -04:00
parent 9de51a38bc
commit cfd3686d8e
1 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ debuginfo() {
APP_STATUS='uninstalled'
# Check whether kubectl is working.
timeout -k 5 5 kubectl get node ${HOSTNAME} &> /dev/null
timeout -k 10 10 kubectl get node ${HOSTNAME} &> /dev/null
if [ $? -ne 0 ]; then
ocf_log info "kubectl isn't working."
STATUS="Primary"
@ -174,7 +174,7 @@ get_pod_and_status() {
# The "timeout" call is in case we're in the middle of swacting and kubectl
# isn't responding, in which case the audit should catch any issues.
PODNAME=`timeout -k 5 5 kubectl -n openstack get pod --field-selector spec.nodeName=${HOSTNAME} \
PODNAME=`timeout -k 10 10 kubectl -n openstack get pod --field-selector spec.nodeName=${HOSTNAME} \
-l application=mariadb,component=server -o=jsonpath='{.items[0].metadata.name'}`
if [ $? -ne 0 ]; then
ocf_log info "Error getting mariadb server pod name on this node."