diff --git a/charts/meta-monitoring/Chart.yaml b/charts/meta-monitoring/Chart.yaml index 0161152..bf3052c 100644 --- a/charts/meta-monitoring/Chart.yaml +++ b/charts/meta-monitoring/Chart.yaml @@ -42,7 +42,4 @@ dependencies: - name: minio repository: https://charts.min.io version: "5.0.11" - tags: - - local-logs - - local-metrics - - local-traces \ No newline at end of file + condition: local.minio.enabled \ No newline at end of file diff --git a/charts/meta-monitoring/templates/validate.yaml b/charts/meta-monitoring/templates/validate.yaml new file mode 100644 index 0000000..767d6ed --- /dev/null +++ b/charts/meta-monitoring/templates/validate.yaml @@ -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 -}} diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index ac7ba5a..0eea3df 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -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: