From 7c91123e2d423adbcaa0346302f82f1f57a88945 Mon Sep 17 00:00:00 2001 From: Aline Abler Date: Fri, 20 Sep 2024 18:56:01 +0200 Subject: [PATCH] Add extraEnvFrom explicitly to those options that ignore the global setting --- class/defaults.yml | 17 +++++++++++++++++ .../templates/backend/statefulset-backend.yaml | 5 ++++- .../10_helm_loki/loki/templates/config.yaml | 4 ++-- .../gateway/deployment-gateway-nginx.yaml | 5 ++++- .../loki/templates/read/deployment-read.yaml | 5 ++++- .../loki/templates/write/statefulset-write.yaml | 5 ++++- 6 files changed, 35 insertions(+), 6 deletions(-) diff --git a/class/defaults.yml b/class/defaults.yml index efca35e..93119bb 100644 --- a/class/defaults.yml +++ b/class/defaults.yml @@ -75,6 +75,7 @@ parameters: endpoint: \${S3_ENDPOINT} secretAccessKey: \${S3_SECRET_ACCESS_KEY} accessKeyId: \${S3_ACCESS_KEY_ID} + s3ForcePathStyle: true podSecurityContext: fsGroup: null @@ -87,6 +88,9 @@ parameters: deploymentMode: SimpleScalable backend: + extraEnvFrom: + - secretRef: + name: loki-bucket-secret extraArgs: - '-config.expand-env=true' nodeSelector: ${loki:globalNodeSelector} @@ -99,6 +103,9 @@ parameters: cpu: 0.5 memory: 1Gi read: + extraEnvFrom: + - secretRef: + name: loki-bucket-secret extraArgs: - '-config.expand-env=true' nodeSelector: ${loki:globalNodeSelector} @@ -111,6 +118,9 @@ parameters: cpu: 1 memory: 3Gi write: + extraEnvFrom: + - secretRef: + name: loki-bucket-secret extraArgs: - '-config.expand-env=true' nodeSelector: ${loki:globalNodeSelector} @@ -160,6 +170,11 @@ parameters: nodeSelector: ${loki:globalNodeSelector} replicas: 0 gateway: + extraEnvFrom: + - secretRef: + name: loki-bucket-secret + extraArgs: + - '-config.expand-env=true' nodeSelector: ${loki:globalNodeSelector} replicas: 2 @@ -170,6 +185,8 @@ parameters: extraEnvFrom: - secretRef: name: loki-bucket-secret + extraArgs: + - '-config.expand-env=true' dnsService: dns-default dnsNamespace: openshift-dns diff --git a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/backend/statefulset-backend.yaml b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/backend/statefulset-backend.yaml index 82a8886..1fb2eff 100644 --- a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/backend/statefulset-backend.yaml +++ b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/backend/statefulset-backend.yaml @@ -27,7 +27,7 @@ spec: template: metadata: annotations: - checksum/config: 7d0ae1d009ee1eb3f732e47396ab769f149cace0bd00d72b9ba754f28c3bede4 + checksum/config: f75dace34ca1a3d7ac1dc1dacbe31a8fba51ccc104b73c6528308b9781a2ad11 labels: app.kubernetes.io/component: backend app.kubernetes.io/instance: loki @@ -69,6 +69,9 @@ spec: - -target=backend - -legacy-read-mode=false - -config.expand-env=true + envFrom: + - secretRef: + name: loki-bucket-secret image: docker.io/grafana/loki:3.1.1 imagePullPolicy: IfNotPresent name: loki diff --git a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/config.yaml b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/config.yaml index 9e654af..0789ecb 100644 --- a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/config.yaml +++ b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/config.yaml @@ -28,7 +28,7 @@ data: bucketnames: loki-chunks endpoint: ${S3_ENDPOINT} insecure: false - s3forcepathstyle: false + s3forcepathstyle: true secret_access_key: ${S3_SECRET_ACCESS_KEY} frontend: scheduler_address: "" @@ -76,7 +76,7 @@ data: bucketnames: loki-ruler endpoint: ${S3_ENDPOINT} insecure: false - s3forcepathstyle: false + s3forcepathstyle: true secret_access_key: ${S3_SECRET_ACCESS_KEY} type: s3 runtime_config: diff --git a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/gateway/deployment-gateway-nginx.yaml b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/gateway/deployment-gateway-nginx.yaml index f6994a0..aec0a74 100644 --- a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/gateway/deployment-gateway-nginx.yaml +++ b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/gateway/deployment-gateway-nginx.yaml @@ -37,7 +37,10 @@ spec: app.kubernetes.io/component: gateway topologyKey: kubernetes.io/hostname containers: - - image: docker.io/nginxinc/nginx-unprivileged:1.27-alpine + - envFrom: + - secretRef: + name: loki-bucket-secret + image: docker.io/nginxinc/nginx-unprivileged:1.27-alpine imagePullPolicy: IfNotPresent name: nginx ports: diff --git a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/read/deployment-read.yaml b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/read/deployment-read.yaml index cd2b3be..ea9cc7d 100644 --- a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/read/deployment-read.yaml +++ b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/read/deployment-read.yaml @@ -26,7 +26,7 @@ spec: template: metadata: annotations: - checksum/config: 7d0ae1d009ee1eb3f732e47396ab769f149cace0bd00d72b9ba754f28c3bede4 + checksum/config: f75dace34ca1a3d7ac1dc1dacbe31a8fba51ccc104b73c6528308b9781a2ad11 labels: app.kubernetes.io/component: read app.kubernetes.io/instance: loki @@ -48,6 +48,9 @@ spec: - -legacy-read-mode=false - -common.compactor-grpc-address=loki-backend.syn-loki.svc.cluster.local:9095 - -config.expand-env=true + envFrom: + - secretRef: + name: loki-bucket-secret image: docker.io/grafana/loki:3.1.1 imagePullPolicy: IfNotPresent name: loki diff --git a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/write/statefulset-write.yaml b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/write/statefulset-write.yaml index 428a091..6433569 100644 --- a/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/write/statefulset-write.yaml +++ b/tests/golden/defaults/loki/loki/10_helm_loki/loki/templates/write/statefulset-write.yaml @@ -24,7 +24,7 @@ spec: template: metadata: annotations: - checksum/config: 7d0ae1d009ee1eb3f732e47396ab769f149cace0bd00d72b9ba754f28c3bede4 + checksum/config: f75dace34ca1a3d7ac1dc1dacbe31a8fba51ccc104b73c6528308b9781a2ad11 labels: app.kubernetes.io/component: write app.kubernetes.io/instance: loki @@ -44,6 +44,9 @@ spec: - -config.file=/etc/loki/config/config.yaml - -target=write - -config.expand-env=true + envFrom: + - secretRef: + name: loki-bucket-secret image: docker.io/grafana/loki:3.1.1 imagePullPolicy: IfNotPresent name: loki