Revert "Revert "Feature 11010: Use of upstream helm charts for Prometheus and Grafana...
[osm/devops.git] / installers / helm / osm / templates / mon / mon-deployment.yaml
index 6d70356..4fcbd58 100644 (file)
@@ -76,7 +76,14 @@ spec:
             - secretRef:
                 name: {{ .Values.mon.secretName | default "mon-secret" }}
           {{- end }}
+          {{- if or .Values.vca.enabled .Values.mon.useOsmSecret }}
           env:
+            - name: OSMMON_GRAFANA_PASSWORD
+              valueFrom:
+                secretKeyRef:
+                  name: grafana
+                  key: admin-password
+            {{- if .Values.vca.enabled }}
             - name: OSMMON_VCA_HOST
               valueFrom:
                 secretKeyRef:
@@ -92,12 +99,14 @@ spec:
                 secretKeyRef:
                   name: {{ include "osm.fullname" . }}-vca-secret
                   key: OSM_VCA_CACERT
-          {{- if .Values.mon.useOsmSecret }}
+            {{- end }}
+            {{- if .Values.mon.useOsmSecret }}
             - name: OSMMON_DATABASE_COMMONKEY
               valueFrom:
                 secretKeyRef:
                   name: {{ include "osm.fullname" . }}-secret
                   key: OSM_DATABASE_COMMONKEY
+            {{- end }}
           {{- end }}
       {{- with .Values.global.nodeSelector }}
       nodeSelector:
@@ -111,4 +120,4 @@ spec:
       tolerations:
         {{- toYaml . | nindent 8 }}
       {{- end }}
-{{- end }}
\ No newline at end of file
+{{- end }}