AETHER-2234 move and update aether-roc-umbrella
Change-Id: I7ca845b92dff1fce5fd87d42053a43d80cc55f34
diff --git a/aether-roc-umbrella/templates/post-install-job-grafana.yaml b/aether-roc-umbrella/templates/post-install-job-grafana.yaml
new file mode 100644
index 0000000..d31e3c6
--- /dev/null
+++ b/aether-roc-umbrella/templates/post-install-job-grafana.yaml
@@ -0,0 +1,72 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+{{ if .Values.import.grafana.enabled }}
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: "{{ .Release.Name }}"
+ labels:
+ app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
+ app.kubernetes.io/instance: {{ .Release.Name | quote }}
+ app.kubernetes.io/version: {{ .Chart.AppVersion }}
+ helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ annotations:
+ # This is what defines this resource as a hook. Without this line, the
+ # job is considered part of the release.
+ "helm.sh/hook": post-install
+ "helm.sh/hook-weight": "-5"
+ {{- if .Values.grafana.tidyUpPostInstall }}
+ "helm.sh/hook-delete-policy": hook-succeeded
+ {{- end}}
+spec:
+ template:
+ metadata:
+ name: "{{ .Release.Name }}"
+ labels:
+ app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
+ app.kubernetes.io/instance: {{ .Release.Name | quote }}
+ helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ spec:
+ restartPolicy: Never
+ containers:
+ - name: post-install-job
+ image: "onosproject/onos-cli:v0.7.32"
+ env:
+ - name: GF_SECURITY_ADMIN_USER
+ valueFrom:
+ secretKeyRef:
+ name: {{ .Release.Name }}-grafana
+ key: admin-user
+ - name: GF_SECURITY_ADMIN_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ .Release.Name }}-grafana
+ key: admin-password
+ command: ["/usr/local/bin/grafana-create-orgs.sh"]
+ args:
+ - "$(GF_SECURITY_ADMIN_USER)"
+ - "$(GF_SECURITY_ADMIN_PASSWORD)"
+ - "{{ .Release.Name }}"
+ - "{{ .Release.Name }}-grafana"
+ - "/usr/local/dashboards/templated"
+ {{- range $org, $vcs := .Values.grafana.orgs }}
+ - {{ printf "%s%s" $org $vcs | quote }}
+ {{- end}}
+ volumeMounts:
+ - name: post-install
+ mountPath: /usr/local/bin
+ readOnly: true
+ - name: dashboards-templated
+ mountPath: /usr/local/dashboards/templated
+ readOnly: true
+ volumes:
+ - name: post-install
+ configMap:
+ name: {{ .Release.Name }}-grafana-post-install
+ defaultMode: 0555
+ - name: dashboards-templated
+ configMap:
+ name: {{ .Release.Name }}-dashboards-templated
+
+ {{end}}