Add helm chart for ca and config files.
[pti/o2.git] / charts / templates / deployment.yaml
index a25f326..d229f44 100644 (file)
@@ -30,6 +30,7 @@ spec:
       labels:
         app: o2api
     spec:
+      serviceAccountName: {{ .Values.o2ims.serviceaccountname }}
       imagePullSecrets:
         - name: {{ .Values.o2ims.imagePullSecrets }}
 {{- if .Values.o2ims.affinity }}
@@ -109,8 +110,8 @@ spec:
           ports:
             - containerPort: 80
           env:
-            - name: API_HOST
-              value: api
+            - name: API_HOST_EXTERNAL_FLOATING
+              value: {{ .Values.ocloud.API_HOST_EXTERNAL_FLOATING }}
             - name: DB_HOST
               value: postgres
             - name: DB_PASSWORD
@@ -130,12 +131,53 @@ spec:
               value: "1"
             - name: REDIS_HOST
               value: redis
+            - name: HELM_USER_PASSWD
+              value: {{ .Values.ocloud.HELM_USER_PASSWD }}
           command: ["/bin/bash", "/opt/o2api_start.sh"]
           volumeMounts:
             - name: scripts
               mountPath: /opt
+            - name: configs
+              mountPath: /configs
+            - name: applicationconfig
+              mountPath: /configs/o2app.conf
+              subPath: config.json
+              readOnly: true
+            - name: caconfig
+              mountPath: /configs/ca.cert
+              subPath: config.json
+              readOnly: true
+            - name: serverkeyconfig
+              mountPath: /configs/server.key
+              subPath: config.json
+              readOnly: true
+        - name: helmcli
+          image: "{{ .Values.o2ims.image.repository }}:{{ .Values.o2ims.image.tag }}"
+          ports:
+            - containerPort: 22
+          env:
+            - name: API_HOST_EXTERNAL_FLOATING
+              value: {{ .Values.ocloud.API_HOST_EXTERNAL_FLOATING }}
+            - name: HELM_USER_PASSWD
+              value: {{ .Values.ocloud.HELM_USER_PASSWD }}
+          command: ["/bin/bash", "/opt/o2_helmcli_start.sh"]
+          volumeMounts:
+            - name: scripts
+              mountPath: /opt
       volumes:
         - name: scripts
           configMap:
             name: {{ .Chart.Name }}-scripts-configmap
+        - name: configs
+          emptyDir: {}
+        - configMap:
+            name: {{ .Chart.Name }}-application-config
+          name: applicationconfig
+        - configMap:
+            name: {{ .Chart.Name }}-serverkeyconfig
+          name: serverkeyconfig
+        - configMap:
+            name: {{ .Chart.Name }}-caconfig
+          name: caconfig
 ---
+