Skip to content

Commit

Permalink
move public and private dashboards to separate sub-charts
Browse files Browse the repository at this point in the history
  • Loading branch information
hervenicol committed Oct 10, 2023
1 parent 062cbbb commit d1443a7
Show file tree
Hide file tree
Showing 86 changed files with 421 additions and 0 deletions.
12 changes: 12 additions & 0 deletions helm/dashboards/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dependencies:
- name: public_dashboards
repository: ""
version: 1.0.0
- name: private_dashboards_al
repository: ""
version: 1.0.0
- name: private_dashboards_mz
repository: ""
version: 1.0.0
digest: sha256:70e15e8c0291ae2b93b05321e0c909ee9987dcb5c2149aa1d61093555a12c331
generated: "2023-10-09T17:22:22.796321595+02:00"
7 changes: 7 additions & 0 deletions helm/dashboards/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ version: [[ .Version ]]
annotations:
application.giantswarm.io/team: "atlas"
config.giantswarm.io/version: 1.x.x
dependencies:
- name: public_dashboards
version: 1.0.0
- name: private_dashboards_al
version: 1.0.0
- name: private_dashboards_mz
version: 1.0.0
11 changes: 11 additions & 0 deletions helm/dashboards/charts/private_dashboards_al/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
description: Grafana dashboards accessible by Giant Swarm customers
engine: gotpl
home: https://github.com/giantswarm/dashboards
icon: https://s.giantswarm.io/app-icons/grafana/1/light.svg
name: private_dashboards_al
appVersion: 1.0.0
version: 1.0.0
annotations:
application.giantswarm.io/team: "atlas"
config.giantswarm.io/version: 1.x.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
apiVersion: v1
kind: ConfigMapList
items:
## Home
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/home"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: grafana-home-dashboard
namespace: {{ $.Values.namespace }}
data:
home.json: {{ (tpl ($.Files.Get "dashboards/home.json") .) | quote }}
## Mixins dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/mixin/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/mixin"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-mixin-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Shared public dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/shared/public/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/shared"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-shared-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Shared private dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/shared/private/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/shared"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-shared-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Provider specific public dashboards
{{- range $path, $fileContents := $.Files.Glob (printf "dashboards/%s/public/*.json" $.Values.provider.kind) }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/{{ $.Values.provider.kind }}"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-%s-%s-dashboard" $.Values.provider.kind $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Provider specific private dashboards
{{- range $path, $fileContents := $.Files.Glob (printf "dashboards/%s/private/*.json" $.Values.provider.kind) }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/{{ $.Values.provider.kind }}"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-%s-%s-dashboard" $.Values.provider.kind $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
11 changes: 11 additions & 0 deletions helm/dashboards/charts/private_dashboards_mz/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
description: Grafana dashboards accessible by Giant Swarm customers
engine: gotpl
home: https://github.com/giantswarm/dashboards
icon: https://s.giantswarm.io/app-icons/grafana/1/light.svg
name: private_dashboards_mz
appVersion: 1.0.0
version: 1.0.0
annotations:
application.giantswarm.io/team: "atlas"
config.giantswarm.io/version: 1.x.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
apiVersion: v1
kind: ConfigMapList
items:
## Home
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/home"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: grafana-home-dashboard
namespace: {{ $.Values.namespace }}
data:
home.json: {{ (tpl ($.Files.Get "dashboards/home.json") .) | quote }}
## Mixins dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/mixin/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/mixin"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-mixin-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Shared public dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/shared/public/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/shared"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-shared-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Shared private dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/shared/private/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/shared"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-shared-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Provider specific public dashboards
{{- range $path, $fileContents := $.Files.Glob (printf "dashboards/%s/public/*.json" $.Values.provider.kind) }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/{{ $.Values.provider.kind }}"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-%s-%s-dashboard" $.Values.provider.kind $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Provider specific private dashboards
{{- range $path, $fileContents := $.Files.Glob (printf "dashboards/%s/private/*.json" $.Values.provider.kind) }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/{{ $.Values.provider.kind }}"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-%s-%s-dashboard" $.Values.provider.kind $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
14 changes: 14 additions & 0 deletions helm/dashboards/charts/public_dashboards/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v2
description: Grafana dashboards accessible by Giant Swarm customers
engine: gotpl
home: https://github.com/giantswarm/dashboards
icon: https://s.giantswarm.io/app-icons/grafana/1/light.svg
name: public_dashboards
appVersion: 1.0.0
version: 1.0.0
annotations:
application.giantswarm.io/team: "atlas"
config.giantswarm.io/version: 1.x.x
dependencies:
- name: public_dashboards
- name: private_dashboards
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
apiVersion: v1
kind: ConfigMapList
items:
## Home
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/home"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: grafana-home-dashboard
namespace: {{ $.Values.namespace }}
data:
home.json: {{ (tpl ($.Files.Get "dashboards/home.json") .) | quote }}
## Mixins dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/mixin/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/mixin"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-mixin-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Shared public dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/shared/public/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/shared"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-shared-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Shared private dashboards
{{- range $path, $fileContents := $.Files.Glob "dashboards/shared/private/*.json" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/shared"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-shared-%s-dashboard" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Provider specific public dashboards
{{- range $path, $fileContents := $.Files.Glob (printf "dashboards/%s/public/*.json" $.Values.provider.kind) }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/public/{{ $.Values.provider.kind }}"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-%s-%s-dashboard" $.Values.provider.kind $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
## Provider specific private dashboards
{{- range $path, $fileContents := $.Files.Glob (printf "dashboards/%s/private/*.json" $.Values.provider.kind) }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
metadata:
annotations:
k8s-sidecar-target-directory: "/var/lib/grafana/dashboards/private/{{ $.Values.provider.kind }}"
labels:
{{- include "labels.common" $ | nindent 6 }}
name: {{ printf "grafana-%s-%s-dashboard" $.Values.provider.kind $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.namespace }}
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
Loading

0 comments on commit d1443a7

Please sign in to comment.