Add template support for pod labels and annotations
[pti/o2.git] / charts / templates / deployment.yaml
index 7d110cb..72e3580 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 Wind River Systems, Inc.
+# Copyright (C) 2021-2023 Wind River Systems, Inc.
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
@@ -29,6 +29,13 @@ spec:
     metadata:
       labels:
         app: o2api
+        {{- with .Values.podLabels }}
+        {{- toYaml . | nindent 8 }}
+        {{- end }}
+      annotations:
+        {{- with .Values.podAnnotations }}
+        {{- toYaml . | nindent 8 }}
+        {{- end }}
     spec:
       serviceAccountName: {{ .Values.o2ims.serviceaccountname }}
       {{- if .Values.imagePullSecrets }}
@@ -135,10 +142,10 @@ spec:
               value: localhost
             - name: DB_PASSWORD
               value: o2ims123
-            - name: FLASK_APP
-              value: /src/o2app/entrypoints/flask_application.py
-            - name: FLASK_DEBUG
-              value: {{ .Values.o2ims.logginglevel }}
+            - name: FLASK_APP
+              value: /src/o2app/entrypoints/flask_application.py
+            - name: FLASK_DEBUG
+              value: {{ .Values.o2ims.logginglevel }}
             - name: LOGGING_CONFIG_LEVEL
               value: {{ .Values.o2ims.logginglevel }}
             - name: OS_AUTH_URL
@@ -156,8 +163,10 @@ spec:
           volumeMounts:
             - name: scripts
               mountPath: /opt
-            # - name: configs
-            #   mountPath: /configs
+            {{- if .Values.o2dms.helm_cli_enable }}
+            - name: share
+              mountPath: /share
+            {{- end }}
             - name: applicationconfig
               mountPath: /configs/o2app.conf
               subPath: config.json
@@ -184,13 +193,17 @@ spec:
           volumeMounts:
             - name: scripts
               mountPath: /opt
+            - name: share
+              mountPath: /share
         {{- end }}
       volumes:
         - name: scripts
           configMap:
             name: {{ .Chart.Name }}-scripts-configmap
-        # - name: configs
-        #   emptyDir: {}
+        {{- if .Values.o2dms.helm_cli_enable }}
+        - name: share
+          emptyDir: {}
+        {{- end }}
         - configMap:
             name: {{ .Chart.Name }}-application-config
           name: applicationconfig