Update chart to support the deployment without persistent database 97/12897/5
authorZhang Rong(Jon) <rong.zhang@windriver.com>
Fri, 10 May 2024 06:36:40 +0000 (14:36 +0800)
committerZhang Rong(Jon) <rong.zhang@windriver.com>
Fri, 24 May 2024 09:28:29 +0000 (17:28 +0800)
In case the O-Cloud may not have the persistent volume,
this commit will continue with the deployment and servicing without
persistent database which requires the persistent volume configuration
in O-Cloud.

Test Plan:
1. Tested the application with persistence database, it was as
expected.
2. Tested the application without persistence database, it was
as expected.

Issue-ID: INF-464

Change-Id: I72c6e3cc1538d2f442e1decc3da1123d2106d0b6
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
charts/templates/deployment.yaml
charts/values.yaml

index 962c1d5..19d7431 100644 (file)
@@ -64,8 +64,10 @@ spec:
           volumeMounts:
             - name: scripts
               mountPath: /opt
+            {{- if .Values.db.persistence }}
             - name: db-pv
               mountPath: /var/lib/postgresql/data
+            {{- end }}
         - name: redis
           image: "{{ .Values.o2ims.images.tags.redis }}"
           ports:
@@ -230,9 +232,11 @@ spec:
         - configMap:
             name: {{ .Chart.Name }}-smocacrt
           name: smocacrt
+        {{- if .Values.db.persistence }}
         - name: db-pv
           persistentVolumeClaim:
             claimName: {{ .Chart.Name }}-db-pv
+        {{- end }}
         {{- if default false .Values.o2ims.useHostCert }}
         - name: ca-certs
           hostPath:
index 8b6c01f..83629c4 100644 (file)
@@ -43,6 +43,7 @@ global:
   namespace: oran-o2
 
 db:
+  persistence: true
   storageSize: 10Gi
 
 # ImagePullSecrets for operator ServiceAccount, list of secrets in the same