diff --git a/chart/templates/logging/fluentbit/fluentbit-helmrelease.yaml b/chart/templates/logging/fluentbit/fluentbit-helmrelease.yaml index cc6986a8daad2a1632612b33351eb722ef2a87ae..7bff2ce70c937f099296655bf3bffe2f2ea114d9 100644 --- a/chart/templates/logging/fluentbit/fluentbit-helmrelease.yaml +++ b/chart/templates/logging/fluentbit/fluentbit-helmrelease.yaml @@ -44,6 +44,10 @@ spec: - name: ek namespace: {{ .Release.Namespace }} {{- end }} + {{- 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/fluentbit/values.yaml b/chart/templates/logging/fluentbit/values.yaml index f474fe106fa5fa120a6a35b2877d627f66c12593..a3c3a22a372cd746f7337e5077631bf523818915 100644 --- a/chart/templates/logging/fluentbit/values.yaml +++ b/chart/templates/logging/fluentbit/values.yaml @@ -67,7 +67,11 @@ config: name loki match kube.* labels job=fluentbit, container=$kubernetes['container_name'], pod=$kubernetes['pod_name'], namespace=$kubernetes['namespace_name'], node_name=$kubernetes['host'] + {{- if eq .Values.loki.strategy "monolith" }} host logging-loki + {{- else }} + host logging-loki-write + {{- end }} port 3100 auto_kubernetes_labels on Retry_Limit False diff --git a/chart/templates/logging/loki/loki-helmrelease.yaml b/chart/templates/logging/loki/loki-helmrelease.yaml index 8f7e88c70c6393355f79934e7452c383ad4992e9..ce498c09445de03efba0e7b1d2b2696665c4ea18 100644 --- a/chart/templates/logging/loki/loki-helmrelease.yaml +++ b/chart/templates/logging/loki/loki-helmrelease.yaml @@ -10,6 +10,7 @@ metadata: app.kubernetes.io/component: "core" {{- include "commonLabels" . | nindent 4}} spec: + releaseName: {{ default "loki" .Values.loki.releaseName }} targetNamespace: logging chart: spec: @@ -54,5 +55,11 @@ spec: - name: kyvernopolicies namespace: {{ .Release.Namespace }} {{- end }} + {{- with .Values.loki.objectStorage }} + {{- if not (and .endpoint .accessKey .accessSecret .bucketNames) }} + - name: minio-operator + namespace: {{ $.Release.Namespace }} + {{- end }} + {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/chart/templates/logging/loki/values.yaml b/chart/templates/logging/loki/values.yaml index 914927dbdece7647911d485a20becfcbb9738db0..8e70521a73774f4969c0c852e93090f2e06bf209 100644 --- a/chart/templates/logging/loki/values.yaml +++ b/chart/templates/logging/loki/values.yaml @@ -17,19 +17,47 @@ image: pullPolicy: {{ .Values.imagePullPolicy }} networkPolicies: - enabled: {{ .Values.networkPolicies.enabled }} - + enabled: {{ .Values.networkPolicies.enabled }} + monitoring: enabled: {{ .Values.monitoring.enabled }} istio: enabled: {{ .Values.istio.enabled }} -serviceMonitor: - enabled: {{ .Values.monitoring.enabled }} +global: + createGlobalConfig: true + existingSecretForConfig: loki-config + + objectStorage: + endpoint: {{ .Values.loki.objectStorage.endpoint }} + region: {{ .Values.loki.objectStorage.region }} + bucketnames: {{ .Values.loki.objectStorage.bucketNames }} + access_key_id: {{ .Values.loki.objectStorage.accessKey }} + secret_access_key: {{ .Values.loki.objectStorage.accessSecret }} + +{{- with .Values.loki.objectStorage }} +{{- if not (and .endpoint .bucketNames .accessKey .accessSecret) }} +minio: + enabled: true +{{- end }} +{{- end }} {{- if .Values.istio.enabled }} podAnnotations: {{ include "istioAnnotation" . }} {{- end }} + +loki: + enabled: {{ eq .Values.loki.strategy "monolith" }} + serviceMonitor: + enabled: {{ .Values.monitoring.enabled }} + +loki-simple-scalable: + enabled: {{ eq .Values.loki.strategy "scalable" }} + imagePullSecrets: + - name: private-registry + serviceMonitor: + enabled: {{ .Values.monitoring.enabled }} + {{- end -}} diff --git a/chart/templates/logging/promtail/values.yaml b/chart/templates/logging/promtail/values.yaml index 392396cbfa2d1d93e5e85d1d1904046af7214f7b..146dc2ee583b078365b49f93efb9be5655d4fefb 100644 --- a/chart/templates/logging/promtail/values.yaml +++ b/chart/templates/logging/promtail/values.yaml @@ -32,6 +32,10 @@ imagePullSecrets: {{- if .Values.loki.enabled }} config: + {{- if eq .Values.loki.strategy "monolith" }} lokiAddress: http://logging-loki.logging.svc.cluster.local:3100/loki/api/v1/push + {{- else }} + lokiAddress: http://logging-loki-write.logging.svc.cluster.local:3100/loki/api/v1/push + {{- end }} {{- end }} {{- end -}} diff --git a/chart/templates/monitoring/values.yaml b/chart/templates/monitoring/values.yaml index c92ae1e99694b2c89069e0ec4d1aae4722baa153..e73ac3c635f00ede090f95473d6178ff5328d27f 100644 --- a/chart/templates/monitoring/values.yaml +++ b/chart/templates/monitoring/values.yaml @@ -215,7 +215,11 @@ grafana: {{- if .Values.loki.enabled }} - name: Loki type: loki + {{- if eq .Values.loki.strategy "monolith" }} url: http://logging-loki.logging.svc.cluster.local:3100 + {{- else }} + url: http://logging-loki-read.logging.svc.cluster.local:3100 + {{- end }} access: proxy {{- end }} {{- if and .Values.loki.enabled .Values.tempo.enabled }} diff --git a/chart/values.yaml b/chart/values.yaml index f96e885816a5a599c1fe0d475efdc54fed814b15..995a9b2ea86d6643435a88bb84bd271ea0178665 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -507,7 +507,7 @@ loki: git: repo: https://repo1.dso.mil/platform-one/big-bang/apps/sandbox/loki.git path: "./chart" - tag: "2.10.1-bb.4" + tag: "3.0.1-bb.0" # -- Flux reconciliation overrides specifically for the Loki Package flux: {} @@ -517,6 +517,28 @@ loki: # -- Post Renderers. See docs/postrenders.md postRenderers: [] + + # -- Loki architecture. Options are monolith and scalable + strategy: monolith + + objectStorage: + # -- S3 compatible endpoint to use for connection information. + # examples: "https://s3.amazonaws.com" "https://s3.us-gov-west-1.amazonaws.com" "http://minio.minio.svc.cluster.local:9000" + endpoint: "" + + # -- S3 compatible region to use for connection information. + region: "" + + # -- Access key for connecting to object storage endpoint. + accessKey: "" + + # -- Secret key for connecting to object storage endpoint. + # Unencoded string data. This should be placed in the secret values and then encrypted + accessSecret: "" + + # -- Bucket Names for Loki as a comma delimited list. + # examples: "loki-logs" + bucketNames: "" # ---------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------- diff --git a/tests/rke2-test-values.yaml b/tests/rke2-test-values.yaml index 494754394b50e632ded73d10927ea737e4e0c2c3..a820342e7d709165672ba620b4fa227f516a7348 100644 --- a/tests/rke2-test-values.yaml +++ b/tests/rke2-test-values.yaml @@ -50,6 +50,16 @@ logging: cpu: .5 limits: null +loki: + values: + loki-simple-scalable: + write: + resources: + limits: null + read: + resources: + limits: null + tempo: values: tempo: diff --git a/tests/test-values.yaml b/tests/test-values.yaml index 37dcc5b468671949186f7d06c92a138750d2aa17..dd09a5b3ef595b1d99e437f2ded04f33c41a574f 100644 --- a/tests/test-values.yaml +++ b/tests/test-values.yaml @@ -460,9 +460,34 @@ fluentbit: loki: enabled: false + strategy: scalable values: - persistence: - enabled: true + global: + createGlobalConfig: true + existingSecretForConfig: "loki-config" + loki-simple-scalable: + write: + replicas: 1 + persistence: + size: 2Gi + resources: + limits: + cpu: 200m + memory: 400Mi + requests: + cpu: 200m + memory: 400Mi + read: + replicas: 1 + persistence: + size: 2Gi + resources: + limits: + cpu: 200m + memory: 400Mi + requests: + cpu: 200m + memory: 400Mi tempo: enabled: false