From 5ae874ed52889b075d3544b6814bcc29a4e07c2c Mon Sep 17 00:00:00 2001 From: Zhe Huang Date: Fri, 26 Jul 2019 15:51:27 -0400 Subject: [PATCH] Add options to configure livenessprobe using values.yaml file. Fix some minor problems. Signed-off-by: Zhe Huang Change-Id: Id58f66feb1e02d244e0845b5dbb90fb3873f39ec --- ric-xapps/90-xApps/bin/install | 3 ++- .../90-xApps/helm/xapp-std/templates/appconfig.yaml | 2 +- .../90-xApps/helm/xapp-std/templates/deployment.yaml | 20 ++++++++------------ .../helm/xapp-std/templates/service-rmr.yaml | 8 ++++---- ric-xapps/90-xApps/helm/xapp-std/values.yaml | 17 ++++++++++++++--- 5 files changed, 29 insertions(+), 21 deletions(-) diff --git a/ric-xapps/90-xApps/bin/install b/ric-xapps/90-xApps/bin/install index 08f45635..3ed7fe60 100755 --- a/ric-xapps/90-xApps/bin/install +++ b/ric-xapps/90-xApps/bin/install @@ -155,7 +155,8 @@ else fi - +mkdir /tmp/$CHART_NAME/config/ +mkdir /tmp/$CHART_NAME/descriptors/ cp $CONFIG_JSON_PATH /tmp/$CHART_NAME/config/ cp $DESCRIPTOR_PATH /tmp/$CHART_NAME/descriptors/ diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml index e08ecc8d..ab8c2940 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml @@ -29,4 +29,4 @@ data: {{- $rtmgrrmrservice := .Values.ricplt.rtmgrRMRService | quote -}} {{- $a1mediatorrmrservice := .Values.ricplt.a1mediatorRMRService | quote -}} -{{ (.Files.Glob "config/*").AsConfig | replace "__DBAAS_SERVICE__" $dbaasservice | replace "__PLT_INGRESS_URL__" $pltingressurl | replace "__XAPP_INGRESS_URL__" $xappingressurl | replace "__APPMGR_RMR_SERVICE__" $appmgrrmrservice | replace "__E2MGR_RMR_SERVICE__" $e2mgrrmrservice | replace "__E2TERM_RMR_SERVICE__" $e2termrmrservice | replace "__RTMGR_RMR_SERVICE__" $rtmgrrmrservice | replace "__A1MEDIATOR_RMR_SERVICE__" $a1mediatorrmrservice | indent 2 }} +{{- (.Files.Glob "config/*").AsConfig | replace "__DBAAS_SERVICE__" $dbaasservice | replace "__PLT_INGRESS_URL__" $pltingressurl | replace "__XAPP_INGRESS_URL__" $xappingressurl | replace "__APPMGR_RMR_SERVICE__" $appmgrrmrservice | replace "__E2MGR_RMR_SERVICE__" $e2mgrrmrservice | replace "__E2TERM_RMR_SERVICE__" $e2termrmrservice | replace "__RTMGR_RMR_SERVICE__" $rtmgrrmrservice | replace "__A1MEDIATOR_RMR_SERVICE__" $a1mediatorrmrservice | nindent 2 }} diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml index 28bd23bb..b539b9b4 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml @@ -46,10 +46,10 @@ spec: - name: http containerPort: {{ .Values.ricxapp.service.http.containerPort }} protocol: TCP - - name: rmrRoute + - name: rmrroute containerPort: {{ .Values.ricxapp.service.rmr.route.port }} protocol: TCP - - name: rmrData + - name: rmrdata containerPort: {{ .Values.ricxapp.service.rmr.data.port }} protocol: TCP volumeMounts: @@ -58,18 +58,14 @@ spec: envFrom: - configMapRef: name: {{ include "ricxapp.configmapname" . }}-appenv + {{- if .Values.ricxapp.livenessProbe }} livenessProbe: - httpGet: - path: {{ .Values.ricxapp.probes.healthAliveCheckEndpoint }} - port: {{ .Values.ricxapp.service.http.containerPort }} - initialDelaySeconds: 5 - periodSeconds: 15 + {{- .Values.ricxapp.livenessProbe | nindent 12 -}} + {{ end }} + {{- if .Values.ricxapp.readinessProbe }} readinessProbe: - httpGet: - path: {{ .Values.ricxapp.probes.healthReadyCheckEndpoint }} - port: {{ .Values.ricxapp.service.http.containerPort }} - initialDelaySeconds: 5 - periodSeconds: 15 + {{- .Values.ricxapp.readinessProbe | nindent 12 -}} + {{ end }} restartPolicy: Always volumes: - name: config-volume diff --git a/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml b/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml index ee1670b1..14a75722 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml @@ -29,13 +29,13 @@ spec: type: ClusterIP ports: - port: {{ .Values.ricxapp.service.rmr.data.port }} - targetPort: rmrData + targetPort: rmrdata protocol: TCP - name: rmrData + name: rmrdata - port: {{ .Values.ricxapp.service.rmr.route.port }} - targetPort: rmrRoute + targetPort: rmrroute protocol: TCP - name: rmrRoute + name: rmrroute selector: app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }} release: {{ .Release.Name }} diff --git a/ric-xapps/90-xApps/helm/xapp-std/values.yaml b/ric-xapps/90-xApps/helm/xapp-std/values.yaml index bf9be32c..50eab3c2 100644 --- a/ric-xapps/90-xApps/helm/xapp-std/values.yaml +++ b/ric-xapps/90-xApps/helm/xapp-std/values.yaml @@ -53,9 +53,20 @@ ricxapp: data: port: 4560 - probes: - healthAliveCheckEndpoint: ric/v1/health/alive - healthReadyCheckEndpoint: ric/v1/health/ready + livenessProbe: |- + httpGet: + path: ric/v1/health/alive + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 15 + + readinessProbe: |- + httpGet: + path: ric/v1/health/ready + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 15 + appconfig: path: /opt/ric/config -- 2.16.6