mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
feat: move grafana dashboard to a subchart (#8619)
* feat: move grafana dashboard to a subchart Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> * fix codegen Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> * fix: add dependencies Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> * fix codegen Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> --------- Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
parent
d3f25dae2a
commit
8731e76faf
8 changed files with 77 additions and 32 deletions
|
@ -70,3 +70,7 @@ annotations:
|
||||||
description: missing image pull policy missing in a couple of deployments
|
description: missing image pull policy missing in a couple of deployments
|
||||||
- kind: added
|
- kind: added
|
||||||
description: added TUF flags for custom sigstore deployments
|
description: added TUF flags for custom sigstore deployments
|
||||||
|
dependencies:
|
||||||
|
- name: grafana
|
||||||
|
version: "0.0.0"
|
||||||
|
condition: grafana.enabled
|
||||||
|
|
|
@ -758,6 +758,10 @@ Please see https://kyverno.io/docs/installation/#security-vs-operability for mor
|
||||||
|
|
||||||
Kubernetes: `>=1.16.0-0`
|
Kubernetes: `>=1.16.0-0`
|
||||||
|
|
||||||
|
| Repository | Name | Version |
|
||||||
|
|------------|------|---------|
|
||||||
|
| | grafana | 0.0.0 |
|
||||||
|
|
||||||
## Maintainers
|
## Maintainers
|
||||||
|
|
||||||
| Name | Email | Url |
|
| Name | Email | Url |
|
||||||
|
|
3
charts/kyverno/charts/grafana/Chart.yaml
Normal file
3
charts/kyverno/charts/grafana/Chart.yaml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
apiVersion: v2
|
||||||
|
name: grafana
|
||||||
|
version: 0.0.0
|
16
charts/kyverno/charts/grafana/README.md
Normal file
16
charts/kyverno/charts/grafana/README.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# grafana
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Key | Type | Default | Description |
|
||||||
|
|-----|------|---------|-------------|
|
||||||
|
| configMapName | string | `"{{ include \"kyverno.fullname\" . }}-grafana"` | Configmap name template. |
|
||||||
|
| namespace | string | `nil` | Namespace to create the grafana dashboard configmap. If not set, it will be created in the same namespace where the chart is deployed. |
|
||||||
|
| annotations | object | `{}` | Grafana dashboard configmap annotations. |
|
||||||
|
| labels | object | `{"grafana_dashboard":"1"}` | Grafana dashboard configmap labels |
|
||||||
|
| grafanaDashboard | object | `{"create":false,"matchLabels":{"dashboards":"grafana"}}` | create GrafanaDashboard custom resource referencing to the configMap. according to https://grafana-operator.github.io/grafana-operator/docs/examples/dashboard_from_configmap/readme/ |
|
||||||
|
|
||||||
|
----------------------------------------------
|
||||||
|
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
|
30
charts/kyverno/charts/grafana/templates/dashboard.yaml
Normal file
30
charts/kyverno/charts/grafana/templates/dashboard.yaml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ tpl .Values.configMapName . }}
|
||||||
|
namespace: {{ default (include "kyverno.namespace" .) .Values.namespace }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml .Values.annotations | nindent 4 }}
|
||||||
|
labels:
|
||||||
|
{{- toYaml .Values.labels | nindent 4 }}
|
||||||
|
data:
|
||||||
|
{{ (.Files.Glob "dashboard/*").AsConfig | indent 2 }}
|
||||||
|
---
|
||||||
|
{{- if .Values.grafanaDashboard.create -}}
|
||||||
|
{{ range $path, $_ := .Files.Glob "dashboard/*" -}}
|
||||||
|
{{ $name := base $path }}
|
||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: {{ tpl $.Values.configMapName $ }}-{{ $name }}
|
||||||
|
namespace: {{ default (include "kyverno.namespace" $ ) $.Values.namespace }}
|
||||||
|
spec:
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- toYaml $.Values.grafanaDashboard.matchLabels | nindent 6 }}
|
||||||
|
configMapRef:
|
||||||
|
name: {{ tpl $.Values.configMapName $ }}
|
||||||
|
key: {{ $name }}
|
||||||
|
---
|
||||||
|
{{ end -}}
|
||||||
|
{{- end -}}
|
20
charts/kyverno/charts/grafana/values.yaml
Normal file
20
charts/kyverno/charts/grafana/values.yaml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# -- Configmap name template.
|
||||||
|
configMapName: '{{ include "kyverno.fullname" . }}-grafana'
|
||||||
|
|
||||||
|
# -- (string) Namespace to create the grafana dashboard configmap.
|
||||||
|
# If not set, it will be created in the same namespace where the chart is deployed.
|
||||||
|
namespace: ~
|
||||||
|
|
||||||
|
# -- Grafana dashboard configmap annotations.
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
# -- Grafana dashboard configmap labels
|
||||||
|
labels:
|
||||||
|
grafana_dashboard: "1"
|
||||||
|
|
||||||
|
# -- create GrafanaDashboard custom resource referencing to the configMap.
|
||||||
|
# according to https://grafana-operator.github.io/grafana-operator/docs/examples/dashboard_from_configmap/readme/
|
||||||
|
grafanaDashboard:
|
||||||
|
create: false
|
||||||
|
matchLabels:
|
||||||
|
dashboards: "grafana"
|
|
@ -1,32 +0,0 @@
|
||||||
{{- if .Values.grafana.enabled -}}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: {{ tpl .Values.grafana.configMapName . }}
|
|
||||||
namespace: {{ default (include "kyverno.namespace" .) .Values.grafana.namespace }}
|
|
||||||
annotations:
|
|
||||||
{{- toYaml .Values.grafana.annotations | nindent 4 }}
|
|
||||||
labels:
|
|
||||||
{{- toYaml .Values.grafana.labels | nindent 4 }}
|
|
||||||
data:
|
|
||||||
{{ (.Files.Glob "grafana/*").AsConfig | indent 2 }}
|
|
||||||
---
|
|
||||||
{{- if .Values.grafana.grafanaDashboard.create -}}
|
|
||||||
{{ range $path, $_ := .Files.Glob "grafana/*" -}}
|
|
||||||
{{ $name := base $path }}
|
|
||||||
apiVersion: grafana.integreatly.org/v1beta1
|
|
||||||
kind: GrafanaDashboard
|
|
||||||
metadata:
|
|
||||||
name: {{ tpl $.Values.grafana.configMapName $ }}-{{ $name }}
|
|
||||||
namespace: {{ default (include "kyverno.namespace" $ ) $.Values.grafana.namespace }}
|
|
||||||
spec:
|
|
||||||
instanceSelector:
|
|
||||||
matchLabels:
|
|
||||||
{{- toYaml $.Values.grafana.grafanaDashboard.matchLabels | nindent 6 }}
|
|
||||||
configMapRef:
|
|
||||||
name: {{ tpl $.Values.grafana.configMapName $ }}
|
|
||||||
key: {{ $name }}
|
|
||||||
---
|
|
||||||
{{ end -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
Loading…
Add table
Reference in a new issue