Fix DBAAS helm charts timeout flag 57/5757/1
authorTimo Tietavainen <timo.tietavainen@nokia.com>
Fri, 12 Mar 2021 17:10:24 +0000 (19:10 +0200)
committerTimo Tietavainen <timo.tietavainen@nokia.com>
Fri, 12 Mar 2021 17:10:24 +0000 (19:10 +0200)
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 <timo.tietavainen@nokia.com>
Change-Id: Iecf599a02c69adfb9f821271310dceb682d4dbc7

helm/dbaas/templates/statefulset.yaml
helm/dbaas/values.yaml

index 4d1593e..25faf7d 100644 (file)
@@ -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:
index cf275ae..733c15a 100644 (file)
@@ -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