From 9626c49ae95d488a1fe777e824ea02ba53c94f15 Mon Sep 17 00:00:00 2001 From: Timo Tietavainen Date: Fri, 12 Mar 2021 19:10:24 +0200 Subject: [PATCH] Fix DBAAS helm charts timeout flag DBAAS 0.5.0 and 0.5.1 cannot be deployed with default version of helm chart what are under ric-plt/ric-dep repo. Reason is that for ReadinessProbe/LivenessProbe checks there are used Redis ping command what is shielded with timeout command to timeout in case ping happens to hang. DBAAS docker images 0.5.0 and 0.5.1 are based on the Alpine 3.11 OS and in there timeout command syntax has been changed not to have anymore '-t' flag. This means that timeout '-t' flag cannot be used anymore in DBAAS helm charts for the ReadinessProbe/LivenessProbe commands if installed DBAAS image is 0.5.0 or newer one. To fix this issue introduced new configuration option 'probeTimeoutCommand' into values.yaml file what defines the timeout command syntax, by default its value is "timeout" but it can be changed to "timeout -t" in case DBAAS image to be installed is older than 0.5.0. Issue-ID: RIC-761 Signed-off-by: Timo Tietavainen Change-Id: Iecf599a02c69adfb9f821271310dceb682d4dbc7 --- helm/dbaas/templates/statefulset.yaml | 8 ++++---- helm/dbaas/values.yaml | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/helm/dbaas/templates/statefulset.yaml b/helm/dbaas/templates/statefulset.yaml index 4d1593e..25faf7d 100644 --- a/helm/dbaas/templates/statefulset.yaml +++ b/helm/dbaas/templates/statefulset.yaml @@ -107,7 +107,7 @@ spec: command: - /bin/sh - -c - - timeout -t {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping + - {{ .Values.dbaas.probeTimeoutCommand }} {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping initialDelaySeconds: 15 periodSeconds: 5 readinessProbe: @@ -115,7 +115,7 @@ spec: command: - /bin/sh - -c - - timeout -t {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping + - {{ .Values.dbaas.probeTimeoutCommand }} {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping initialDelaySeconds: 15 periodSeconds: 5 ports: @@ -138,7 +138,7 @@ spec: command: - /bin/sh - -c - - timeout -t {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping + - {{ .Values.dbaas.probeTimeoutCommand }} {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping initialDelaySeconds: 15 periodSeconds: 5 readinessProbe: @@ -146,7 +146,7 @@ spec: command: - /bin/sh - -c - - timeout -t {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping + - {{ .Values.dbaas.probeTimeoutCommand }} {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping initialDelaySeconds: 15 periodSeconds: 5 ports: diff --git a/helm/dbaas/values.yaml b/helm/dbaas/values.yaml index cf275ae..733c15a 100644 --- a/helm/dbaas/values.yaml +++ b/helm/dbaas/values.yaml @@ -52,4 +52,10 @@ dbaas: saReplicas: 1 haReplicas: 3 + #Timeout command below requires -t flag if installed DBAAS image is older than + #0.5.0. Reason is that DBAAS image version 0.5.0 and newer ones are based on + #newer Alpine 3.11 OS version and in this Alpine version timeout command + #doesn't have -t flag anymore. + probeTimeoutCommand: "timeout" + #probeTimeoutCommand: "timeout -t" probeTimeout: 10 -- 2.16.6