secureCodeBox/secureCodeBox

View on GitHub
hooks/persistence-elastic/templates/import-dashboard.yaml

Summary

Maintainability
Test Coverage
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0

# We only want to import the example kibana dashboards if they are enabled
{{ if .Values.dashboardImporter.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
  name: "dashboard-importer-{{ .Chart.Version }}"
spec:
  backoffLimit: 3
  ttlSecondsAfterFinished: 3600 # 1 hour
  template:
    spec:
      restartPolicy: 'OnFailure'
      containers:
        - name: dasboard-importer
          image: "{{ .Values.dashboardImporter.image.repository }}:{{ .Values.dashboardImporter.image.tag | default .Chart.Version }}"
          imagePullPolicy: IfNotPresent
          env:
{{- if .Values.externalElasticStack.enabled }}      
            - name: KIBANA_URL
              value: {{ .Values.externalElasticStack.kibanaAddress | quote }}
{{- else }}
            - name: KIBANA_URL
              value: "http://{{ .Release.Name }}-kibana.{{ .Release.Namespace }}.svc.cluster.local:5601"
{{- end }}
{{ end }}