Skip to content

Commit fdb597f

Browse files
committed
Add readiness and liveliness probes such that the simapp can start sending data only when webui is ready
Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>
1 parent 7e7714c commit fdb597f

File tree

5 files changed

+43
-7
lines changed

5 files changed

+43
-7
lines changed

5g-control-plane/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: SD-Core 5G control plane services
1010
name: 5g-control-plane
1111
icon: https://guide.opencord.org/logos/cord.svg
1212

13-
version: 3.1.5
13+
version: 3.1.6
1414

1515
dependencies:
1616
- name: mongodb

5g-control-plane/templates/deployment-webui.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@ spec:
6060
stdin: true
6161
tty: true
6262
command: ["/opt/webui-run.sh"]
63+
readinessProbe:
64+
httpGet:
65+
path: /config/v1/
66+
port: {{ .Values.config.webui.urlport.port }}
67+
scheme: HTTP
68+
initialDelaySeconds: 10
69+
periodSeconds: 5
70+
timeoutSeconds: 3
71+
successThreshold: 1
72+
failureThreshold: 3
73+
livenessProbe:
74+
httpGet:
75+
path: /config/v1/
76+
port: {{ .Values.config.webui.urlport.port }}
77+
scheme: HTTP
78+
initialDelaySeconds: 30
79+
periodSeconds: 10
80+
timeoutSeconds: 3
81+
successThreshold: 1
82+
failureThreshold: 3
6383
{{- if .Values.resources.enabled }}
6484
resources:
6585
{{ toYaml .Values.resources.webui | indent 10 }}

omec-sub-provision/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ description: Mobile Sim Provisioning services
88
name: omec-sub-provision
99
icon: https://guide.opencord.org/logos/cord.svg
1010

11-
version: 2.1.1
11+
version: 2.1.2

omec-sub-provision/templates/deployment-simapp.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,26 @@ spec:
4040
{{ toYaml .Values.images.pullSecrets | indent 8 }}
4141
{{- end }}
4242
initContainers:
43-
- name: wait-simapp-module2
43+
- name: wait-webui-ready
4444
image: {{ .Values.images.repository }}{{ .Values.images.tags.init }}
4545
imagePullPolicy: {{ .Values.images.pullPolicy }}
46-
command: ['sh', '-c', 'until nslookup simapp; do echo waiting for simapp; sleep 4; done;']
46+
command:
47+
- sh
48+
- -c
49+
- |
50+
WEBUI_ADDR={{ index .Values.config.simapp.cfgFiles "simapp.yaml" "configuration" "sub-provision-endpt" "addr" }}
51+
WEBUI_PORT={{ index .Values.config.simapp.cfgFiles "simapp.yaml" "configuration" "sub-provision-endpt" "port" }}
52+
echo "Waiting for ${WEBUI_ADDR} service to be available..."
53+
until nslookup ${WEBUI_ADDR}; do
54+
echo "Waiting for ${WEBUI_ADDR} DNS resolution..."
55+
sleep 2
56+
done
57+
echo "${WEBUI_ADDR} DNS resolved, checking HTTP endpoint readiness..."
58+
until wget -q -O- --timeout=2 http://${WEBUI_ADDR}:${WEBUI_PORT}/config/v1/ >/dev/null 2>&1; do
59+
echo "Waiting for ${WEBUI_ADDR} HTTP endpoint to be ready..."
60+
sleep 3
61+
done
62+
echo "${WEBUI_ADDR} is ready, starting simapp..."
4763
{{- if .Values.config.coreDump.enabled }}
4864
{{ tuple "simapp" . | include "omec-sub-provision.coredump_init" | indent 6 }}
4965
{{- end }}

sdcore-helm-charts/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name: sd-core
1010
description: SD-Core control plane services
1111
icon: https://guide.opencord.org/logos/cord.svg
1212
type: application
13-
version: 3.1.7
13+
version: 3.1.8
1414
home: https://opennetworking.org/sd-core/
1515
maintainers:
1616
- name: SD-Core Support
@@ -23,12 +23,12 @@ dependencies:
2323
condition: omec-control-plane.enable4G
2424

2525
- name: omec-sub-provision
26-
version: 2.1.1
26+
version: 2.1.2
2727
repository: "file://../omec-sub-provision"
2828
condition: omec-sub-provision.enable
2929

3030
- name: 5g-control-plane
31-
version: 3.1.5
31+
version: 3.1.6
3232
repository: "file://../5g-control-plane"
3333
condition: 5g-control-plane.enable5G
3434

0 commit comments

Comments
 (0)