Compare commits

...

6 Commits

Author SHA1 Message Date
Michel Hollands
18f0dc932a Add scraping of kube state metrics
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-07-27 09:23:09 +01:00
Michel Hollands
a1cd5d36b0 Merge pull request #3 from grafana/add_validation
Add validation.yaml
2023-07-07 16:48:20 +01:00
Michel Hollands
a14b07239b Add check for empty list of namespaces to monitor
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
2023-07-06 14:11:08 +01:00
Michel Hollands
116586e383 Add check to if anything is enabled
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
2023-07-06 14:08:15 +01:00
Michel Hollands
67b13388a7 Add validation.yaml
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
2023-07-06 11:58:00 +01:00
Michel Hollands
39a187457c Merge pull request #2 from grafana/enable_dbs_individually
Enable DBs separately
2023-06-30 12:45:08 +01:00
4 changed files with 59 additions and 12 deletions

View File

@@ -42,7 +42,4 @@ dependencies:
- name: minio
repository: https://charts.min.io
version: "5.0.11"
tags:
- local-logs
- local-metrics
- local-traces
condition: local.minio.enabled

View File

@@ -49,6 +49,13 @@ data:
targets = discovery.relabel.rename_meta_labels.output
forward_to = [ {{ include "agent.prometheus_write_targets" . }} ]
}
{{- if .Values.kubeStateMetrics.enabled }}
prometheus.scrape "kubeStateMetrics" {
targets = [ { "__address__" = "{{ .Values.kubeStateMetrics.endpoint }}" } ]
forward_to = [ {{ include "agent.prometheus_write_targets" . }} ]
}
{{- end }}
{{- end }}
{{- if or .Values.local.traces.enabled .Values.cloud.traces.enabled }}

View File

@@ -0,0 +1,39 @@
{{- if not (eq .Values.local.minio.enabled (or .Values.local.traces.enabled (or .Values.local.logs.enabled .Values.local.metrics.enabled))) -}}
{{- fail "minio.enabled should be set to true if any of the the local databases is enabled " -}}
{{- end -}}
{{- if eq .Values.cloud.logs.enabled true -}}
{{- if or (empty .Values.cloud.logs.endpoint) (or (empty .Values.cloud.logs.username) (empty .Values.cloud.logs.password)) -}}
{{- fail "if cloud.logs is enabled then the endpoint, username and password have to be filled in" -}}
{{- end -}}
{{- end -}}
{{- if eq .Values.cloud.metrics.enabled true -}}
{{- if or (empty .Values.cloud.metrics.endpoint) (or (empty .Values.cloud.metrics.username) (empty .Values.cloud.metrics.password)) -}}
{{- fail "if cloud.metrics is enabled then the endpoint, username and password have to be filled in" -}}
{{- end -}}
{{- end -}}
{{- if eq .Values.cloud.traces.enabled true -}}
{{- if or (empty .Values.cloud.traces.endpoint) (or (empty .Values.cloud.traces.username) (empty .Values.cloud.traces.password)) -}}
{{- fail "if cloud.traces is enabled then the endpoint, username and password have to be filled in" -}}
{{- end -}}
{{- end -}}
{{- if eq .Values.cloud.traces.enabled false -}}
{{- if eq .Values.cloud.metrics.enabled false -}}
{{- if eq .Values.cloud.logs.enabled false -}}
{{- if eq .Values.local.traces.enabled false -}}
{{- if eq .Values.local.metrics.enabled false -}}
{{- if eq .Values.local.logs.enabled false -}}
{{- fail "nothing has been enabled" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if empty .Values.namespacesToMonitor -}}
{{- fail "No namespaces have been specified in namespacesToMonitor" -}}
{{- end -}}

View File

@@ -2,15 +2,8 @@ namespacesToMonitor:
- loki
- mimir
- tempo
clusterName: "observability" # TODO check if this can be derived
clusterName: "meta-monitoring" # TODO check if this can be derived
# Turn on or off for local storing of metrics, logs or traces
tags:
local-logs: true
local-metrics: true
local-traces: true
# Unfortunately this is duplicate as Helm's tags and conditions fro dependencies are limited
local:
logs:
enabled: false
@@ -18,6 +11,9 @@ local:
enabled: false
traces:
enabled: false
minio:
enabled: false # This should be set to true if any of the previous is enabled
cloud:
logs:
@@ -41,6 +37,14 @@ global:
rootUser: "rootuser"
rootPassword: "rootpassword"
kubeStateMetrics:
# Scrape https://github.com/kubernetes/kube-state-metrics by default
enabled: true
# This endpoint is created when the helm chart from
# https://artifacthub.io/packages/helm/prometheus-community/kube-state-metrics/
# is used. Change this if kube-state-metrics is installed somewhere else.
endpoint: kube-state-metrics.kube-state-metrics.svc.cluster.local:8080
# The following are configuration for the dependencies.
# These should not be changed.