feat(grafana): enabled/disabled configurable

!8
This commit is contained in:
2024-02-04 15:01:04 +09:30
parent c5bb46f48a
commit e0cb8f57e2
16 changed files with 43 additions and 6 deletions

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
{{ if .Values.nfc_monitoring.additions.dashboard_sidecar.enabled -}}
---
apiVersion: rbac.authorization.k8s.io/v1
@ -14,3 +15,4 @@ rules:
resources: ["configmaps"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- end }}

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
{{ if .Values.nfc_monitoring.additions.dashboard_sidecar.enabled -}}
---
kind: ClusterRoleBinding
@ -18,3 +19,4 @@ subjects:
name: grafana
namespace: "{{ .Values.nfc_monitoring.grafana.namespace }}"
{{- end }}
{{- end }}

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
---
apiVersion: v1
kind: ConfigMap
@ -123,4 +124,4 @@ data:
}
}
---
{{- end }}

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
{{ if .Values.nfc_monitoring.additions.dashboard_sidecar.enabled -}}
---
# Provisioning config
@ -27,3 +28,4 @@ data:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
{{- end }}
{{- end }}

View File

@ -1,4 +1,5 @@
---
{{ if .Values.nfc_monitoring.grafana.enabled -}}
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
@ -147,3 +148,5 @@ spec:
resources:
requests:
storage: "5Gi"
{{- end }}

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
@ -16,3 +17,5 @@ spec:
grafanaCom:
id: 9578
revision: 4 # as @ 19-09-23
{{- end }}

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
---
{{- if .Values.nfc_monitoring.additions.ceph.enabled | default false -}}
apiVersion: grafana.integreatly.org/v1beta1
@ -19,3 +20,4 @@ spec:
revision: 17 # as @ 19-09-23
{{- end -}}
{{- end }}

View File

@ -1,4 +1,5 @@
---
{{ if .Values.nfc_monitoring.grafana.enabled -}}
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
@ -17,3 +18,4 @@ spec:
json: >-
{{ $Dashboard | toRawJson }}
{{- end }}

View File

@ -1,4 +1,5 @@
---
{{ if .Values.nfc_monitoring.grafana.enabled -}}
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
@ -16,3 +17,5 @@ spec:
grafanaCom:
id: 1860
revision: 32 # as @ 19-09-23
{{- end }}

View File

@ -1,4 +1,5 @@
---
{{ if .Values.nfc_monitoring.grafana.enabled -}}
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasourceList
items:
@ -24,3 +25,4 @@ items:
{{ toYaml . | nindent 8 }}
{{ end }}
{{- end }}

View File

@ -12,7 +12,8 @@ spec:
{{ end }}
{{ if .Values.nfc_monitoring.grafana.ingress.enabled | default "false" -}}
{{ if .Values.nfc_monitoring.grafana.enabled -}}
{{ if .Values.nfc_monitoring.grafana.ingress.enabled -}}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
@ -25,6 +26,7 @@ spec:
{{ toYaml $.Values.nfc_monitoring.grafana.ingress.spec | nindent 2 }}
{{ end }}
{{ end }}
{{ if .Values.nfc_monitoring.prometheus.ingress.enabled | default "false" -}}
---

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
@ -32,3 +33,5 @@ spec:
- expr: |
sum by (namespace, job, handler, status_code) (rate(grafana_http_request_duration_seconds_count[5m]))
record: namespace_job_handler_statuscode:grafana_http_request_duration_seconds_count:rate5m
{{- end }}

View File

@ -1,5 +1,5 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
---
apiVersion: v1
kind: Service
metadata:
@ -24,3 +24,5 @@ spec:
#nodePort: 3000
#type: LoadBalancer
sessionAffinity: ClientIP
{{- end }}

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
---
apiVersion: v1
automountServiceAccountToken: false
@ -10,3 +11,5 @@ metadata:
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/part-of: {{ $.Chart.Name }}
app.kubernetes.io/version: {{ $.Chart.Version }}
{{- end }}

View File

@ -1,3 +1,4 @@
{{ if .Values.nfc_monitoring.grafana.enabled -}}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
@ -31,3 +32,5 @@ spec:
matchLabels:
{{ toYaml $.Values.nfc_monitoring.grafana.labels | nindent 6 }}
app.kubernetes.io/part-of: {{ $.Chart.Name }}
{{- end }}

View File

@ -52,6 +52,8 @@ nfc_monitoring:
grafana:
enabled: false
# Grafana Configuration
# Type: Dict
# See: https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana