diff --git a/chart/templates/logging/loki/gitrepository.yaml b/chart/templates/logging/loki/gitrepository.yaml index 12901ce6ce8040020926929d1659015c0eee55de..b5ff4ef77094f0c4ce6e79ebd3b6efc18b7d6d2c 100644 --- a/chart/templates/logging/loki/gitrepository.yaml +++ b/chart/templates/logging/loki/gitrepository.yaml @@ -1,4 +1,4 @@ -{{- if and (not .Values.offline) (or .Values.loki.enabled .Values.promtail.enabled) }} +{{- if and (not .Values.offline) .Values.loki.enabled }} apiVersion: source.toolkit.fluxcd.io/v1beta2 kind: GitRepository metadata: diff --git a/chart/templates/logging/loki/imagepullsecret.yaml b/chart/templates/logging/loki/imagepullsecret.yaml index ee27a6926a85b870a06272392918cdffde03a11b..680cae918b66faf9ce7a14fbbd08d5b6ee9f75e3 100644 --- a/chart/templates/logging/loki/imagepullsecret.yaml +++ b/chart/templates/logging/loki/imagepullsecret.yaml @@ -1,4 +1,4 @@ -{{- if or .Values.loki.enabled .Values.promtail.enabled }} +{{- if .Values.loki.enabled }} {{- if ( include "imagePullSecret" . ) }} apiVersion: v1 kind: Secret diff --git a/chart/templates/logging/loki/loki-helmrelease.yaml b/chart/templates/logging/loki/loki-helmrelease.yaml index 5f9de6441988d21f72af99c82999402f1e674f82..6a38553f5347fafb8818729b5719388984ba7971 100644 --- a/chart/templates/logging/loki/loki-helmrelease.yaml +++ b/chart/templates/logging/loki/loki-helmrelease.yaml @@ -1,5 +1,5 @@ {{- $fluxSettingsLoki := merge .Values.loki.flux .Values.flux -}} -{{- if or .Values.loki.enabled .Values.promtail.enabled }} +{{- if .Values.loki.enabled }} apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: diff --git a/chart/templates/logging/loki/values.yaml b/chart/templates/logging/loki/values.yaml index f75d5401d37cd066df344a23d947f90ddecc2184..4b797969310f39b82233a345479ada26e2918a5e 100644 --- a/chart/templates/logging/loki/values.yaml +++ b/chart/templates/logging/loki/values.yaml @@ -1,4 +1,4 @@ -{{- if or .Values.loki.enabled .Values.promtail.enabled }} +{{- if .Values.loki.enabled }} {{- include "values-secret" (dict "root" $ "package" .Values.loki "name" "loki" "defaults" (include "bigbang.defaults.loki" .)) }} {{- end }} @@ -35,7 +35,7 @@ monitoring: {{- end }} istio: - enabled: {{ .Values.istio.enabled }} + enabled: {{ .Values.istio.enabled }} loki: storage: diff --git a/chart/templates/logging/promtail/promtail-helmrelease.yaml b/chart/templates/logging/promtail/promtail-helmrelease.yaml index 34dea54aca8809ac49f0af3dc0428e8db11cf613..a92789b853366347bee7896720ff18f06ef95da6 100644 --- a/chart/templates/logging/promtail/promtail-helmrelease.yaml +++ b/chart/templates/logging/promtail/promtail-helmrelease.yaml @@ -37,10 +37,11 @@ spec: kind: Secret valuesKey: "overlays" -{{/* promtail _always_ depend on .Values.loki being enabled, so can assume they exist here */}} dependsOn: + {{- if .Values.loki.enabled }} - name: loki namespace: {{ .Release.Namespace }} + {{- end }} {{- if .Values.gatekeeper.enabled }} - name: gatekeeper namespace: {{ .Release.Namespace }} diff --git a/chart/templates/logging/promtail/values.yaml b/chart/templates/logging/promtail/values.yaml index 693d6c45597f7abae9421ad25929ea7c7dbcda57..6bbc8a3b3d4439be5950897a6c8abb9fbc54cf30 100644 --- a/chart/templates/logging/promtail/values.yaml +++ b/chart/templates/logging/promtail/values.yaml @@ -52,4 +52,11 @@ config: - url: http://logging-loki-write.logging.svc.cluster.local:3100/loki/api/v1/push {{- end }} {{- end }} +# If loki is disabled and promtail is not +{{- if and (not .Values.loki.enabled) (.Values.promtail.enabled) }} +# Promtail must have config.clients provided +{{- if or (empty .Values.promtail.values.config) (empty .Values.promtail.values.config.clients) }} +{{- fail "If Promtail is enabled and Loki is disabled, at least one client must be provided via '.Values.promtail.values.config.clients'"}} +{{- end -}} +{{- end -}} {{- end -}}