From 1229a8e24f2310533dc358351ff98f27eb257056 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:42:36 +0300 Subject: [PATCH 001/124] test adding components maping --- production/helm/loki/templates/_helpers.tpl | 24 +++++++++++++++++++++ production/helm/loki/templates/v1-test.yaml | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 production/helm/loki/templates/v1-test.yaml diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 4ec80d2b4db29..1f74c1cf00efc 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -46,6 +46,30 @@ Params: {{- $resourceName -}} {{- end -}} +{{/* +loki.componentSectionFromName returns the sections from the user .Values in YAML +that corresponds to the requested component. loki.componentSectionFromName takes two arguments + .ctx = the root context of the chart + .component = the name of the component. mimir.componentSectionFromName uses an internal mapping to know + which component lives where in the values.yaml +Examples: + $componentSection := include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml + $componentSection.podLabels ... +*/}} +{{- define "loki.componentSectionFromName" -}} +{{- $componentsMap := dict + "ingester" "ingester" +-}} +{{- $componentSection := index $componentsMap .component -}} +{{- if not $componentSection -}}{{- printf "No component section mapping for %s not found in values; submit a bug report if you are a user, edit loki.componentSectionFromName if you are a contributor" .component | fail -}}{{- end -}} +{{- $section := .ctx.Values -}} +{{- range regex Split "\\." $componentSection -1 -}} + {{- $section = index $section . -}} + {{- if not $section -}}{{- printf "Component section %s not found in values; values: %s" . ($.ctx.Values | toJson | abbrev 100) | fail -}}{{- end -}} +{{- end -}} +{{- $section | toYaml -}} +{{- end -}} + {{/* Return if deployment mode is simple scalable */}} diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml new file mode 100644 index 0000000000000..6c6c081327bbb --- /dev/null +++ b/production/helm/loki/templates/v1-test.yaml @@ -0,0 +1,2 @@ +{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} +{{- $zonesMap := include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file From a8cb051970f099cd157aeae81cdbeed4d12c98f4 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:48:23 +0300 Subject: [PATCH 002/124] fix typing error --- production/helm/loki/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 1f74c1cf00efc..3be19d0149798 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -63,7 +63,7 @@ Examples: {{- $componentSection := index $componentsMap .component -}} {{- if not $componentSection -}}{{- printf "No component section mapping for %s not found in values; submit a bug report if you are a user, edit loki.componentSectionFromName if you are a contributor" .component | fail -}}{{- end -}} {{- $section := .ctx.Values -}} -{{- range regex Split "\\." $componentSection -1 -}} +{{- range regexSplit "\\." $componentSection -1 -}} {{- $section = index $section . -}} {{- if not $section -}}{{- printf "Component section %s not found in values; values: %s" . ($.ctx.Values | toJson | abbrev 100) | fail -}}{{- end -}} {{- end -}} From d507e1f548734d0e198e31a78d6085537d49535d Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:11:04 +0300 Subject: [PATCH 003/124] fix test --- production/helm/loki/templates/v1-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 6c6c081327bbb..621add443d221 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1,2 +1,2 @@ {{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} -{{- $zonesMap := include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file +{{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file From 694341e166a7f509b05ce9b67d82c477975ed6ec Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:12:48 +0300 Subject: [PATCH 004/124] comment in test file --- production/helm/loki/templates/v1-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 621add443d221..02a280108b990 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1,2 +1,2 @@ -{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} -{{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file +#{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} +#{{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file From 2beccf1ce41b0169fb9e31d0725e673f1c9eb91a Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:13:25 +0300 Subject: [PATCH 005/124] uncomment test file --- production/helm/loki/templates/v1-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 02a280108b990..621add443d221 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1,2 +1,2 @@ -#{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} -#{{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file +{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} +{{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file From 9ca02ee9389d646d3a2b23098e8118e99e4adf50 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:16:37 +0300 Subject: [PATCH 006/124] change test v1 --- production/helm/loki/templates/v1-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 621add443d221..5bec86d508f70 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1,2 +1,2 @@ -{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} -{{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file +{{- $componentSection := include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml -}} +{ \ No newline at end of file From 5fa5f15104cb50e51abef3e5c1ebfdb7dfacbc69 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:16:56 +0300 Subject: [PATCH 007/124] fix type error in v1-test --- production/helm/loki/templates/v1-test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 5bec86d508f70..e9378ee944b60 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1,2 +1 @@ {{- $componentSection := include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml -}} -{ \ No newline at end of file From 95eef9f1cb254dc877473a296fb18744c61a66a3 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:27:44 +0300 Subject: [PATCH 008/124] fix test --- production/helm/loki/templates/v1-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index e9378ee944b60..1c6d1f64e3d3d 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1 +1 @@ -{{- $componentSection := include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml -}} +{{- include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml -}} From c137832ec08dd4d029054cc852528006f2a48580 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:27:56 +0300 Subject: [PATCH 009/124] fix type error --- production/helm/loki/templates/v1-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 1c6d1f64e3d3d..e9a27bd5b12f3 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1 +1 @@ -{{- include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml -}} +{{- include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml -}} From ff0ae76f2c88643d94c5f51fed404ba32c892b18 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:31:07 +0300 Subject: [PATCH 010/124] fix test --- production/helm/loki/templates/v1-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index e9a27bd5b12f3..c6b0256d7ff55 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1 +1 @@ -{{- include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml -}} +{{ include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml }} From 348beedd31cc6acba3f9e80ccf86e1a38f3f3c71 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:32:10 +0300 Subject: [PATCH 011/124] test --- production/helm/loki/templates/v1-test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index c6b0256d7ff55..621add443d221 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1 +1,2 @@ -{{ include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml }} +{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} +{{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file From 6b17f0380893f125e5ceb1de2dd5b61943bdce8b Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:40:43 +0300 Subject: [PATCH 012/124] test --- production/helm/loki/templates/v1-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 621add443d221..93c443f99735a 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1,2 +1,2 @@ -{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} +{{- $args := dict "ctx" . "component" "ingester" -}} {{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file From 0e2a0474ae03ac9709d724d564fa9369937e3332 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:44:29 +0300 Subject: [PATCH 013/124] test --- production/helm/loki/templates/v1-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 93c443f99735a..621add443d221 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1,2 +1,2 @@ -{{- $args := dict "ctx" . "component" "ingester" -}} +{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} {{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file From 1c1f16e446171b3b48e4162d2e3526c9fffc85ce Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:11:37 +0300 Subject: [PATCH 014/124] test --- production/helm/loki/templates/v1-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml index 621add443d221..7da4c5614d747 100644 --- a/production/helm/loki/templates/v1-test.yaml +++ b/production/helm/loki/templates/v1-test.yaml @@ -1,2 +1,2 @@ -{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} -{{- include "loki.componentSectionFromName" $args | fromYaml -}} \ No newline at end of file +{{- $args := dict "ctx" . "component" "ingester" -}} +{{- include "loki.componentSectionFromName" $args }} \ No newline at end of file From 81b58ce91e4585a8901edb398949bcd3dc70b3c7 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:35:12 +0300 Subject: [PATCH 015/124] deploy loki zone-redundancy --- production/helm/loki/templates/_helpers.tpl | 58 +++++ .../ingester/service-ingester-headless.yaml | 4 +- .../service-ingester-zone-a-headless.yaml | 35 --- .../service-ingester-zone-b-headless.yaml | 35 --- .../service-ingester-zone-c-headless.yaml | 35 --- .../templates/ingester/service-ingester.yaml | 9 +- .../ingester/statefulset-ingester-zone-a.yaml | 232 ------------------ .../ingester/statefulset-ingester-zone-b.yaml | 232 ------------------ .../ingester/statefulset-ingester-zone-c.yaml | 232 ------------------ .../ingester/statefulset-ingester.yaml | 49 ++-- 10 files changed, 94 insertions(+), 827 deletions(-) delete mode 100644 production/helm/loki/templates/ingester/service-ingester-zone-a-headless.yaml delete mode 100644 production/helm/loki/templates/ingester/service-ingester-zone-b-headless.yaml delete mode 100644 production/helm/loki/templates/ingester/service-ingester-zone-c-headless.yaml delete mode 100644 production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml delete mode 100644 production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml delete mode 100644 production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 3be19d0149798..1a6212a388d1d 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -70,6 +70,64 @@ Examples: {{- $section | toYaml -}} {{- end -}} +{{/* +Creates dict for zone-aware replication configuration +Params: + ctx = . context + component = component name +Return value: + { + zoneName: { + affinity: , + nodeSelector: , + replicas: , + storageClass: + }, + ... + } +During migration there is a special case where an extra "zone" is generated with zonaName == "" empty string. +The empty string evaluates to false in boolean expressions so it is treated as the default (non zone-aware) zone, +which allows us to keep generating everything for the default zone. +*/}} +{{- define "loki.zoneAwareReplicationMap" -}} +{{- $zonesMap := (dict) -}} +{{- $componentSection := include "loki.componentSectionFromName" . | fromYaml -}} +{{- $defaultZone := (dict "affinity" $componentSection.affinity "nodeSelector" $componentSection.nodeSelector "replicas" $componentSection.replicas "storageClass" $componentSection.storageClass) -}} + +{{- if $componentSection.zoneAwareReplication.enabled -}} +{{- $numberOfZones := len $componentSection.zoneAwareReplication.zones -}} +{{- if lt $numberOfZones 3 -}} +{{- fail "When zone-awareness is enabled, you must have at least 3 zones defined." -}} +{{- end -}} + +{{- $requestedReplicas := $componentSection.replicas -}} +{{- if and (has .component (list "ingester" )) $componentSection.zoneAwareReplication.migration.enabled (not $componentSection.zoneAwareReplication.migration.writePath) -}} +{{- $requestedReplicas = $componentSection.zoneAwareReplication.migration.replicas }} +{{- end -}} +{{- $replicaPerZone := div (add $requestedReplicas $numberOfZones -1) $numberOfZones -}} + +{{- range $idx, $rolloutZone := $componentSection.zoneAwareReplication.zones -}} +{{- $_ := set $zonesMap $rolloutZone.name (dict + "affinity" (($rolloutZone.extraAffinity | default (dict)) | mergeOverwrite (include "mimir.zoneAntiAffinity" (dict "component" $.component "rolloutZoneName" $rolloutZone.name "topologyKey" $componentSection.zoneAwareReplication.topologyKey ) | fromYaml ) ) + "nodeSelector" ($rolloutZone.nodeSelector | default (dict) ) + "replicas" $replicaPerZone + "storageClass" $rolloutZone.storageClass + ) -}} +{{- end -}} +{{- if $componentSection.zoneAwareReplication.migration.enabled -}} +{{- if $componentSection.zoneAwareReplication.migration.scaleDownDefaultZone -}} +{{- $_ := set $defaultZone "replicas" 0 -}} +{{- end -}} +{{- $_ := set $zonesMap "" $defaultZone -}} +{{- end -}} + +{{- else -}} +{{- $_ := set $zonesMap "" $defaultZone -}} +{{- end -}} +{{- $zonesMap | toYaml }} + +{{- end -}} + {{/* Return if deployment mode is simple scalable */}} diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index e83dcf7be4fe6..dba19809d4589 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -1,9 +1,7 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed (or (not .Values.ingester.zoneAwareReplication.enabled) .Values.ingester.zoneAwareReplication.migration.enabled) }} apiVersion: v1 kind: Service metadata: - name: {{ include "loki.ingesterFullname" . }}-headless + name: {{ include "mimir.resourceName" (dict "ctx" . "component" "ingester") }}-headless namespace: {{ .Release.Namespace }} labels: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} diff --git a/production/helm/loki/templates/ingester/service-ingester-zone-a-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-zone-a-headless.yaml deleted file mode 100644 index 478ea8c89eff8..0000000000000 --- a/production/helm/loki/templates/ingester/service-ingester-zone-a-headless.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: {{ include "loki.ingesterFullname" . }}-zone-a-headless - namespace: {{ .Release.Namespace }} - labels: - {{- include "loki.ingesterLabels" . | nindent 4 }} - {{- with .Values.ingester.serviceLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.loki.serviceAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - clusterIP: None - ports: - - name: http-metrics - port: 3100 - targetPort: http-metrics - protocol: TCP - - name: grpc - port: 9095 - targetPort: grpc - protocol: TCP - {{- if .Values.ingester.appProtocol.grpc }} - appProtocol: {{ .Values.ingester.appProtocol.grpc }} - {{- end }} - selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} - name: ingester-zone-a - rollout-group: ingester -{{- end -}} diff --git a/production/helm/loki/templates/ingester/service-ingester-zone-b-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-zone-b-headless.yaml deleted file mode 100644 index c19ed4cb1f654..0000000000000 --- a/production/helm/loki/templates/ingester/service-ingester-zone-b-headless.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: {{ include "loki.ingesterFullname" . }}-zone-b-headless - namespace: {{ .Release.Namespace }} - labels: - {{- include "loki.ingesterLabels" . | nindent 4 }} - {{- with .Values.ingester.serviceLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.loki.serviceAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - clusterIP: None - ports: - - name: http-metrics - port: 3100 - targetPort: http-metrics - protocol: TCP - - name: grpc - port: 9095 - targetPort: grpc - protocol: TCP - {{- if .Values.ingester.appProtocol.grpc }} - appProtocol: {{ .Values.ingester.appProtocol.grpc }} - {{- end }} - selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} - name: ingester-zone-b - rollout-group: ingester -{{- end -}} diff --git a/production/helm/loki/templates/ingester/service-ingester-zone-c-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-zone-c-headless.yaml deleted file mode 100644 index 2757fcef94002..0000000000000 --- a/production/helm/loki/templates/ingester/service-ingester-zone-c-headless.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: {{ include "loki.ingesterFullname" . }}-zone-c-headless - namespace: {{ .Release.Namespace }} - labels: - {{- include "loki.ingesterLabels" . | nindent 4 }} - {{- with .Values.ingester.serviceLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.loki.serviceAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - clusterIP: None - ports: - - name: http-metrics - port: 3100 - targetPort: http-metrics - protocol: TCP - - name: grpc - port: 9095 - targetPort: grpc - protocol: TCP - {{- if .Values.ingester.appProtocol.grpc }} - appProtocol: {{ .Values.ingester.appProtocol.grpc }} - {{- end }} - selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} - name: ingester-zone-c - rollout-group: ingester -{{- end -}} diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index d762cbf65d95f..79345a3463e7b 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -1,9 +1,12 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed (or (not .Values.ingester.zoneAwareReplication.enabled) .Values.ingester.zoneAwareReplication.migration.enabled) }} +{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} +{{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} +{{- range $zoneName, $rolloutZone := $zonesMap }} +{{- with $ -}} +{{- $_ := set $args "rolloutZoneName" $zoneName -}} apiVersion: v1 kind: Service metadata: - name: {{ include "loki.ingesterFullname" . }} + name: {{ include "mimir.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: {{- include "loki.ingesterLabels" . | nindent 4 }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml b/production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml deleted file mode 100644 index 13c7018e53e21..0000000000000 --- a/production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml +++ /dev/null @@ -1,232 +0,0 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }} -{{- $replicas := (include "loki.ingester.replicaCount" .) -}} -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ include "loki.ingesterFullname" . }}-zone-a - namespace: {{ .Release.Namespace }} - labels: - {{- include "loki.ingesterLabels" . | nindent 4 }} - app.kubernetes.io/part-of: memberlist - rollout-group: ingester - name: ingester-zone-a - annotations: - rollout-max-unavailable: "{{ include "loki.ingester.maxUnavailable" (dict "ctx" . "replicas" $replicas)}}" - {{- with .Values.loki.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneA.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if not .Values.ingester.autoscaling.enabled }} - replicas: {{ $replicas }} -{{- end }} - podManagementPolicy: Parallel - serviceName: {{ include "loki.ingesterFullname" . }}-zone-a - revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} - {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC) }} - {{/* - Data on the read nodes is easy to replace, so we want to always delete PVCs to make - operation easier, and will rely on re-fetching data when needed. - */}} - persistentVolumeClaimRetentionPolicy: - whenDeleted: {{ .Values.ingester.persistence.whenDeleted }} - whenScaled: {{ .Values.ingester.persistence.whenScaled }} - {{- end }} - selector: - matchLabels: - {{- include "loki.ingesterSelectorLabels" . | nindent 6 }} - name: ingester-zone-a - rollout-group: ingester - updateStrategy: - type: OnDelete - template: - metadata: - annotations: - {{- include "loki.config.checksum" . | nindent 8 }} - {{- with .Values.loki.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneA.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} - app.kubernetes.io/part-of: memberlist - name: ingester-zone-a - rollout-group: ingester - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} - {{- with .Values.ingester.topologySpreadConstraints }} - topologySpreadConstraints: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- end }} - serviceAccountName: {{ include "loki.serviceAccountName" . }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.hostAliases }} - hostAliases: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- include "loki.ingesterPriorityClassName" . | nindent 6 }} - securityContext: - {{- toYaml .Values.loki.podSecurityContext | nindent 8 }} - terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }} - {{- with .Values.ingester.initContainers }} - initContainers: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: ingester - image: {{ include "loki.image" . }} - imagePullPolicy: {{ .Values.loki.image.pullPolicy }} - {{- if or .Values.loki.command .Values.ingester.command }} - command: - - {{ coalesce .Values.ingester.command .Values.loki.command | quote }} - {{- end }} - args: - - -config.file=/etc/loki/config/config.yaml - - -ingester.availability-zone=zone-a - - -ingester.unregister-on-shutdown=false - - -ingester.tokens-file-path=/var/loki/ring-tokens - - -target=ingester - {{- with .Values.ingester.extraArgs }} - {{- toYaml . | nindent 12 }} - {{- end }} - ports: - - name: http-metrics - containerPort: 3100 - protocol: TCP - - name: grpc - containerPort: 9095 - protocol: TCP - - name: http-memberlist - containerPort: 7946 - protocol: TCP - {{- with .Values.ingester.extraEnv }} - env: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.extraEnvFrom }} - envFrom: - {{- toYaml . | nindent 12 }} - {{- end }} - securityContext: - {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }} - {{- include "loki.ingester.readinessProbe" . | nindent 10 }} - {{- include "loki.ingester.livenessProbe" . | nindent 10 }} - volumeMounts: - - name: config - mountPath: /etc/loki/config - - name: runtime-config - mountPath: /etc/loki/runtime-config - - name: data - mountPath: /var/loki - {{- if .Values.enterprise.enabled }} - - name: license - mountPath: /etc/loki/license - {{- end }} - {{- with .Values.ingester.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.resources }} - resources: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.lifecycle }} - lifecycle: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- if .Values.ingester.extraContainers }} - {{- toYaml .Values.ingester.extraContainers | nindent 8}} - {{- end }} - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: rollout-group - operator: In - values: - - ingester - - key: name - operator: NotIn - values: - - ingester-zone-a - topologyKey: kubernetes.io/hostname - {{- with .Values.ingester.zoneAwareReplication.zoneA.extraAffinity }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneA.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - - name: config - {{- include "loki.configVolume" . | nindent 10 }} - - name: runtime-config - configMap: - name: {{ template "loki.name" . }}-runtime - {{- if .Values.enterprise.enabled }} - - name: license - secret: - {{- if .Values.enterprise.useExternalLicense }} - secretName: {{ .Values.enterprise.externalLicenseName }} - {{- else }} - secretName: enterprise-logs-license - {{- end }} - {{- end }} - {{- with .Values.ingester.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- if not .Values.ingester.persistence.enabled }} - - name: data - emptyDir: {} - {{- else if .Values.ingester.persistence.inMemory }} - - name: data - {{- if .Values.ingester.persistence.inMemory }} - emptyDir: - medium: Memory - {{- end }} - {{- if .Values.ingester.persistence.size }} - sizeLimit: {{ .Values.ingester.persistence.size }} - {{- end }} - {{- else }} - volumeClaimTemplates: - {{- range .Values.ingester.persistence.claims }} - - metadata: - name: {{ .name }} - {{- with .annotations }} - annotations: - {{- . | toYaml | nindent 10 }} - {{- end }} - spec: - accessModes: - - ReadWriteOnce - {{- with .storageClass }} - storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} - {{- end }} - resources: - requests: - storage: {{ .size | quote }} - {{- end }} - {{- end }} -{{- end }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml b/production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml deleted file mode 100644 index 3af81ae6477ef..0000000000000 --- a/production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml +++ /dev/null @@ -1,232 +0,0 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }} -{{- $replicas := (include "loki.ingester.replicaCount" .) -}} -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ include "loki.ingesterFullname" . }}-zone-b - namespace: {{ .Release.Namespace }} - labels: - {{- include "loki.ingesterLabels" . | nindent 4 }} - app.kubernetes.io/part-of: memberlist - rollout-group: ingester - name: ingester-zone-b - annotations: - rollout-max-unavailable: "{{ include "loki.ingester.maxUnavailable" (dict "ctx" . "replicas" $replicas)}}" - {{- with .Values.loki.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneB.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if not .Values.ingester.autoscaling.enabled }} - replicas: {{ $replicas }} -{{- end }} - podManagementPolicy: Parallel - serviceName: {{ include "loki.ingesterFullname" . }}-zone-b - revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} - {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC) }} - {{/* - Data on the read nodes is easy to replace, so we want to always delete PVCs to make - operation easier, and will rely on re-fetching data when needed. - */}} - persistentVolumeClaimRetentionPolicy: - whenDeleted: {{ .Values.ingester.persistence.whenDeleted }} - whenScaled: {{ .Values.ingester.persistence.whenScaled }} - {{- end }} - selector: - matchLabels: - {{- include "loki.ingesterSelectorLabels" . | nindent 6 }} - name: ingester-zone-b - rollout-group: ingester - updateStrategy: - type: OnDelete - template: - metadata: - annotations: - {{- include "loki.config.checksum" . | nindent 8 }} - {{- with .Values.loki.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneB.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} - app.kubernetes.io/part-of: memberlist - name: ingester-zone-b - rollout-group: ingester - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} - {{- with .Values.ingester.topologySpreadConstraints }} - topologySpreadConstraints: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- end }} - serviceAccountName: {{ include "loki.serviceAccountName" . }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.hostAliases }} - hostAliases: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- include "loki.ingesterPriorityClassName" . | nindent 6 }} - securityContext: - {{- toYaml .Values.loki.podSecurityContext | nindent 8 }} - terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }} - {{- with .Values.ingester.initContainers }} - initContainers: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: ingester - image: {{ include "loki.image" . }} - imagePullPolicy: {{ .Values.loki.image.pullPolicy }} - {{- if or .Values.loki.command .Values.ingester.command }} - command: - - {{ coalesce .Values.ingester.command .Values.loki.command | quote }} - {{- end }} - args: - - -config.file=/etc/loki/config/config.yaml - - -ingester.availability-zone=zone-b - - -ingester.unregister-on-shutdown=false - - -ingester.tokens-file-path=/var/loki/ring-tokens - - -target=ingester - {{- with .Values.ingester.extraArgs }} - {{- toYaml . | nindent 12 }} - {{- end }} - ports: - - name: http-metrics - containerPort: 3100 - protocol: TCP - - name: grpc - containerPort: 9095 - protocol: TCP - - name: http-memberlist - containerPort: 7946 - protocol: TCP - {{- with .Values.ingester.extraEnv }} - env: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.extraEnvFrom }} - envFrom: - {{- toYaml . | nindent 12 }} - {{- end }} - securityContext: - {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }} - {{- include "loki.ingester.readinessProbe" . | nindent 10 }} - {{- include "loki.ingester.livenessProbe" . | nindent 10 }} - volumeMounts: - - name: config - mountPath: /etc/loki/config - - name: runtime-config - mountPath: /etc/loki/runtime-config - - name: data - mountPath: /var/loki - {{- if .Values.enterprise.enabled }} - - name: license - mountPath: /etc/loki/license - {{- end }} - {{- with .Values.ingester.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.resources }} - resources: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.lifecycle }} - lifecycle: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- if .Values.ingester.extraContainers }} - {{- toYaml .Values.ingester.extraContainers | nindent 8}} - {{- end }} - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: rollout-group - operator: In - values: - - ingester - - key: name - operator: NotIn - values: - - ingester-zone-b - topologyKey: kubernetes.io/hostname - {{- with .Values.ingester.zoneAwareReplication.zoneB.extraAffinity }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneB.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - - name: config - {{- include "loki.configVolume" . | nindent 10 }} - - name: runtime-config - configMap: - name: {{ template "loki.name" . }}-runtime - {{- if .Values.enterprise.enabled }} - - name: license - secret: - {{- if .Values.enterprise.useExternalLicense }} - secretName: {{ .Values.enterprise.externalLicenseName }} - {{- else }} - secretName: enterprise-logs-license - {{- end }} - {{- end }} - {{- with .Values.ingester.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- if not .Values.ingester.persistence.enabled }} - - name: data - emptyDir: {} - {{- else if .Values.ingester.persistence.inMemory }} - - name: data - {{- if .Values.ingester.persistence.inMemory }} - emptyDir: - medium: Memory - {{- end }} - {{- if .Values.ingester.persistence.size }} - sizeLimit: {{ .Values.ingester.persistence.size }} - {{- end }} - {{- else }} - volumeClaimTemplates: - {{- range .Values.ingester.persistence.claims }} - - metadata: - name: {{ .name }} - {{- with .annotations }} - annotations: - {{- . | toYaml | nindent 10 }} - {{- end }} - spec: - accessModes: - - ReadWriteOnce - {{- with .storageClass }} - storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} - {{- end }} - resources: - requests: - storage: {{ .size | quote }} - {{- end }} - {{- end }} -{{- end }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml b/production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml deleted file mode 100644 index 30393fa4d2cae..0000000000000 --- a/production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml +++ /dev/null @@ -1,232 +0,0 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }} -{{- $replicas := (include "loki.ingester.replicaCount" .) -}} -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ include "loki.ingesterFullname" . }}-zone-c - namespace: {{ .Release.Namespace }} - labels: - {{- include "loki.ingesterLabels" . | nindent 4 }} - app.kubernetes.io/part-of: memberlist - rollout-group: ingester - name: ingester-zone-c - annotations: - rollout-max-unavailable: "{{ include "loki.ingester.maxUnavailable" (dict "ctx" . "replicas" $replicas)}}" - {{- with .Values.loki.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneC.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if not .Values.ingester.autoscaling.enabled }} - replicas: {{ $replicas }} -{{- end }} - podManagementPolicy: Parallel - serviceName: {{ include "loki.ingesterFullname" . }}-zone-c - revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} - {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC) }} - {{/* - Data on the read nodes is easy to replace, so we want to always delete PVCs to make - operation easier, and will rely on re-fetching data when needed. - */}} - persistentVolumeClaimRetentionPolicy: - whenDeleted: {{ .Values.ingester.persistence.whenDeleted }} - whenScaled: {{ .Values.ingester.persistence.whenScaled }} - {{- end }} - selector: - matchLabels: - {{- include "loki.ingesterSelectorLabels" . | nindent 6 }} - name: ingester-zone-c - rollout-group: ingester - updateStrategy: - type: OnDelete - template: - metadata: - annotations: - {{- include "loki.config.checksum" . | nindent 8 }} - {{- with .Values.loki.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneC.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} - app.kubernetes.io/part-of: memberlist - name: ingester-zone-c - rollout-group: ingester - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} - {{- with .Values.ingester.topologySpreadConstraints }} - topologySpreadConstraints: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- end }} - serviceAccountName: {{ include "loki.serviceAccountName" . }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.hostAliases }} - hostAliases: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- include "loki.ingesterPriorityClassName" . | nindent 6 }} - securityContext: - {{- toYaml .Values.loki.podSecurityContext | nindent 8 }} - terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }} - {{- with .Values.ingester.initContainers }} - initContainers: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: ingester - image: {{ include "loki.image" . }} - imagePullPolicy: {{ .Values.loki.image.pullPolicy }} - {{- if or .Values.loki.command .Values.ingester.command }} - command: - - {{ coalesce .Values.ingester.command .Values.loki.command | quote }} - {{- end }} - args: - - -config.file=/etc/loki/config/config.yaml - - -ingester.availability-zone=zone-c - - -ingester.unregister-on-shutdown=false - - -ingester.tokens-file-path=/var/loki/ring-tokens - - -target=ingester - {{- with .Values.ingester.extraArgs }} - {{- toYaml . | nindent 12 }} - {{- end }} - ports: - - name: http-metrics - containerPort: 3100 - protocol: TCP - - name: grpc - containerPort: 9095 - protocol: TCP - - name: http-memberlist - containerPort: 7946 - protocol: TCP - {{- with .Values.ingester.extraEnv }} - env: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.extraEnvFrom }} - envFrom: - {{- toYaml . | nindent 12 }} - {{- end }} - securityContext: - {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }} - {{- include "loki.ingester.readinessProbe" . | nindent 10 }} - {{- include "loki.ingester.livenessProbe" . | nindent 10 }} - volumeMounts: - - name: config - mountPath: /etc/loki/config - - name: runtime-config - mountPath: /etc/loki/runtime-config - - name: data - mountPath: /var/loki - {{- if .Values.enterprise.enabled }} - - name: license - mountPath: /etc/loki/license - {{- end }} - {{- with .Values.ingester.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.resources }} - resources: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ingester.lifecycle }} - lifecycle: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- if .Values.ingester.extraContainers }} - {{- toYaml .Values.ingester.extraContainers | nindent 8}} - {{- end }} - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: rollout-group - operator: In - values: - - ingester - - key: name - operator: NotIn - values: - - ingester-zone-c - topologyKey: kubernetes.io/hostname - {{- with .Values.ingester.zoneAwareReplication.zoneC.extraAffinity }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.zoneAwareReplication.zoneC.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - - name: config - {{- include "loki.configVolume" . | nindent 10 }} - - name: runtime-config - configMap: - name: {{ template "loki.name" . }}-runtime - {{- if .Values.enterprise.enabled }} - - name: license - secret: - {{- if .Values.enterprise.useExternalLicense }} - secretName: {{ .Values.enterprise.externalLicenseName }} - {{- else }} - secretName: enterprise-logs-license - {{- end }} - {{- end }} - {{- with .Values.ingester.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- if not .Values.ingester.persistence.enabled }} - - name: data - emptyDir: {} - {{- else if .Values.ingester.persistence.inMemory }} - - name: data - {{- if .Values.ingester.persistence.inMemory }} - emptyDir: - medium: Memory - {{- end }} - {{- if .Values.ingester.persistence.size }} - sizeLimit: {{ .Values.ingester.persistence.size }} - {{- end }} - {{- else }} - volumeClaimTemplates: - {{- range .Values.ingester.persistence.claims }} - - metadata: - name: {{ .name }} - {{- with .annotations }} - annotations: - {{- . | toYaml | nindent 10 }} - {{- end }} - spec: - accessModes: - - ReadWriteOnce - {{- with .storageClass }} - storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} - {{- end }} - resources: - requests: - storage: {{ .size | quote }} - {{- end }} - {{- end }} -{{- end }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 9f3368a4b83e9..806dd76dc623e 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -1,9 +1,12 @@ -{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if and $isDistributed (or (not .Values.ingester.zoneAwareReplication.enabled) .Values.ingester.zoneAwareReplication.migration.enabled) }} +{{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} +{{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} +{{- range $zoneName, $rolloutZone := $zonesMap }} +{{- with $ -}} +{{- $_ := set $args "rolloutZoneName" $zoneName -}} apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ include "loki.ingesterFullname" . }} + name: {{ include "loki.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: {{- include "loki.ingesterLabels" . | nindent 4 }} @@ -14,7 +17,7 @@ metadata: {{- end }} spec: {{- if not .Values.ingester.autoscaling.enabled }} - replicas: {{ .Values.ingester.replicas }} + replicas: {{ $rolloutZone.replicas }} {{- end }} podManagementPolicy: Parallel updateStrategy: @@ -139,12 +142,12 @@ spec: {{- if .Values.ingester.extraContainers }} {{- toYaml .Values.ingester.extraContainers | nindent 8}} {{- end }} - {{- with .Values.ingester.affinity }} - affinity: + {{- with $rolloutZone.nodeSelector }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.ingester.nodeSelector }} - nodeSelector: + {{- with $rolloutZone.affinity }} + affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.ingester.tolerations }} @@ -183,22 +186,28 @@ spec: {{- end }} {{- else }} volumeClaimTemplates: - {{- range .Values.ingester.persistence.claims }} - - metadata: - name: {{ .name }} - {{- with .annotations }} - annotations: - {{- . | toYaml | nindent 10 }} - {{- end }} + {{- with $rolloutZone.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $rolloutZone.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} spec: accessModes: - ReadWriteOnce - {{- with .storageClass }} - storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} + {{- $storageClass := default .Values.ingester.persistentVolume.storageClass $rolloutZone.storageClass }} + {{- if $storageClass }} + {{- if (eq "-" $storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: {{ $storageClass }} + {{- end }} {{- end }} resources: requests: storage: {{ .size | quote }} - {{- end }} - {{- end }} -{{- end }} +--- +{{ end }} +{{ end }} From 85d39ec12acf17065fa934d573ad193b935e9aed Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:47:01 +0300 Subject: [PATCH 016/124] fix type error --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 806dd76dc623e..8a0c266aa2acd 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -208,6 +208,5 @@ spec: resources: requests: storage: {{ .size | quote }} ---- {{ end }} {{ end }} From 9e15747750d41d4a0c121628f3b350de4b217305 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:48:23 +0300 Subject: [PATCH 017/124] fix --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 8a0c266aa2acd..21c902a7fedf1 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -207,6 +207,6 @@ spec: {{- end }} resources: requests: - storage: {{ .size | quote }} + storage: "{{ .Values.ingester.persistentVolume.size }}" {{ end }} {{ end }} From 57cd4e93955a5ea18cd4938eac91968717eb790c Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:51:17 +0300 Subject: [PATCH 018/124] fix --- .../ingester/statefulset-ingester.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 21c902a7fedf1..4369dcb926d7e 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -186,14 +186,14 @@ spec: {{- end }} {{- else }} volumeClaimTemplates: - {{- with $rolloutZone.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with $rolloutZone.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: storage + {{- if .Values.ingester.persistentVolume.annotations }} + annotations: + {{- toYaml .Values.ingester.persistentVolume.annotations | nindent 10 }} + {{- end }} spec: accessModes: - ReadWriteOnce @@ -207,6 +207,7 @@ spec: {{- end }} resources: requests: - storage: "{{ .Values.ingester.persistentVolume.size }}" + storage: {{ .size | quote }} +--- {{ end }} {{ end }} From a5d06760a7dfb72c866575387325535ee6c3356a Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:51:39 +0300 Subject: [PATCH 019/124] a --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 4369dcb926d7e..ae96615d716fe 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -208,6 +208,5 @@ spec: resources: requests: storage: {{ .size | quote }} ---- {{ end }} {{ end }} From cbf7c70ac11624eda19f4362dff123da3efb3f16 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:52:07 +0300 Subject: [PATCH 020/124] a --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index ae96615d716fe..70a00833745f1 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -207,6 +207,6 @@ spec: {{- end }} resources: requests: - storage: {{ .size | quote }} + storage: "{{ .Values.ingester.persistentVolume.size }}" {{ end }} {{ end }} From 5cf3144302968c85bc3032a667eef75e9481d760 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:53:23 +0300 Subject: [PATCH 021/124] A --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 70a00833745f1..5ae7680372fa1 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -208,5 +208,6 @@ spec: resources: requests: storage: "{{ .Values.ingester.persistentVolume.size }}" + {{- end }} {{ end }} {{ end }} From b65b9f86bae86fb22c630f83bec68a9128036632 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:54:17 +0300 Subject: [PATCH 022/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 79345a3463e7b..a54c63bf87577 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,4 +33,5 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} -{{- end -}} +{{ end }} +{{ end }} From 948c6acf459ada71b1d098cc9e6b57cc2780686f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:54:59 +0300 Subject: [PATCH 023/124] fix --- .../helm/loki/templates/ingester/service-ingester-headless.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index dba19809d4589..65f5a3cb07fb9 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -27,4 +27,3 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} -{{- end -}} From 8a04cb6cbfa652d0e4525bed4538692ffe61467f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:55:33 +0300 Subject: [PATCH 024/124] fix --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 5ae7680372fa1..a48d70a1d7a6d 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -1,5 +1,5 @@ {{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} -{{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} +{{- $zonesMap := include "loki.zoneAwareReplicationMap" $args | fromYaml -}} {{- range $zoneName, $rolloutZone := $zonesMap }} {{- with $ -}} {{- $_ := set $args "rolloutZoneName" $zoneName -}} From f84b65740c46c956ff84725e4e1e37448c73c70a Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:56:39 +0300 Subject: [PATCH 025/124] fix --- production/helm/loki/templates/_helpers.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 1a6212a388d1d..2b1033913661d 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -50,7 +50,7 @@ Params: loki.componentSectionFromName returns the sections from the user .Values in YAML that corresponds to the requested component. loki.componentSectionFromName takes two arguments .ctx = the root context of the chart - .component = the name of the component. mimir.componentSectionFromName uses an internal mapping to know + .component = the name of the component. loki.componentSectionFromName uses an internal mapping to know which component lives where in the values.yaml Examples: $componentSection := include "loki.componentSectionFromName" (dict "ctx" . "component" "ingester") | fromYaml @@ -108,7 +108,7 @@ which allows us to keep generating everything for the default zone. {{- range $idx, $rolloutZone := $componentSection.zoneAwareReplication.zones -}} {{- $_ := set $zonesMap $rolloutZone.name (dict - "affinity" (($rolloutZone.extraAffinity | default (dict)) | mergeOverwrite (include "mimir.zoneAntiAffinity" (dict "component" $.component "rolloutZoneName" $rolloutZone.name "topologyKey" $componentSection.zoneAwareReplication.topologyKey ) | fromYaml ) ) + "affinity" (($rolloutZone.extraAffinity | default (dict)) | mergeOverwrite (include "loki.zoneAntiAffinity" (dict "component" $.component "rolloutZoneName" $rolloutZone.name "topologyKey" $componentSection.zoneAwareReplication.topologyKey ) | fromYaml ) ) "nodeSelector" ($rolloutZone.nodeSelector | default (dict) ) "replicas" $replicaPerZone "storageClass" $rolloutZone.storageClass From 2a49309de829d6d4221d806512016ddff44ba14f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:00:54 +0300 Subject: [PATCH 026/124] fix --- production/helm/loki/templates/_helpers.tpl | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 2b1033913661d..a8e94d2a364a0 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -128,6 +128,33 @@ which allows us to keep generating everything for the default zone. {{- end -}} +{{/* +Calculate anti-affinity for a zone +Params: + component = component name + rolloutZoneName = name of the rollout zone + topologyKey = topology key +*/}} +{{- define "loki.zoneAntiAffinity" -}} +{{- if .topologyKey -}} +podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: rollout-group + operator: In + values: + - {{ .component }} + - key: zone + operator: NotIn + values: + - {{ .rolloutZoneName }} + topologyKey: {{ .topologyKey | quote }} +{{- else -}} +{} +{{- end -}} +{{- end -}} + {{/* Return if deployment mode is simple scalable */}} From d0e178b4ec8e31683dfcef43683ffefe30db934f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:01:53 +0300 Subject: [PATCH 027/124] fix --- .../loki/templates/ingester/service-ingester-headless.yaml | 2 +- production/helm/loki/templates/ingester/service-ingester.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index 65f5a3cb07fb9..3cdc02c1bb7e4 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "mimir.resourceName" (dict "ctx" . "component" "ingester") }}-headless + name: {{ include "loki.resourceName" (dict "ctx" . "component" "ingester") }}-headless namespace: {{ .Release.Namespace }} labels: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index a54c63bf87577..4b90963595fef 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -1,12 +1,12 @@ {{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} -{{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} +{{- $zonesMap := include "loki.zoneAwareReplicationMap" $args | fromYaml -}} {{- range $zoneName, $rolloutZone := $zonesMap }} {{- with $ -}} {{- $_ := set $args "rolloutZoneName" $zoneName -}} apiVersion: v1 kind: Service metadata: - name: {{ include "mimir.resourceName" $args }} + name: {{ include "loki.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: {{- include "loki.ingesterLabels" . | nindent 4 }} From fb7db07804b02f1525d0c88b0621152180850c0f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:02:55 +0300 Subject: [PATCH 028/124] delete test-v1 --- production/helm/loki/templates/v1-test.yaml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 production/helm/loki/templates/v1-test.yaml diff --git a/production/helm/loki/templates/v1-test.yaml b/production/helm/loki/templates/v1-test.yaml deleted file mode 100644 index 7da4c5614d747..0000000000000 --- a/production/helm/loki/templates/v1-test.yaml +++ /dev/null @@ -1,2 +0,0 @@ -{{- $args := dict "ctx" . "component" "ingester" -}} -{{- include "loki.componentSectionFromName" $args }} \ No newline at end of file From 3a75cd2e93f8042ea06fdd34723095fe63425251 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:08:18 +0300 Subject: [PATCH 029/124] fix --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index a48d70a1d7a6d..c55ebb6cb85f2 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -209,5 +209,6 @@ spec: requests: storage: "{{ .Values.ingester.persistentVolume.size }}" {{- end }} +--- {{ end }} {{ end }} From 1d286ed9691d751f65eaf4df573f64c686adea93 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:12:56 +0300 Subject: [PATCH 030/124] fix --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 4b90963595fef..a0dc8a34e9764 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,5 +33,7 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + +--- {{ end }} {{ end }} From ee2b65c05b9d54a3797dfdd8f1ca931e04cb7805 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:20:15 +0300 Subject: [PATCH 031/124] fix --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index c55ebb6cb85f2..565ce75b0fdb3 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -195,8 +195,6 @@ spec: {{- toYaml .Values.ingester.persistentVolume.annotations | nindent 10 }} {{- end }} spec: - accessModes: - - ReadWriteOnce {{- $storageClass := default .Values.ingester.persistentVolume.storageClass $rolloutZone.storageClass }} {{- if $storageClass }} {{- if (eq "-" $storageClass) }} @@ -205,6 +203,8 @@ spec: storageClassName: {{ $storageClass }} {{- end }} {{- end }} + accessModes: + {{- toYaml .Values.ingester.persistentVolume.accessModes | nindent 10 }} resources: requests: storage: "{{ .Values.ingester.persistentVolume.size }}" From b124ac863416e9baf156a7d89a415087b058ee39 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:51:16 +0300 Subject: [PATCH 032/124] fix --- production/helm/loki/values.yaml | 58 +++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index dd6df92348ca0..3541a5a155bba 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1763,28 +1763,48 @@ ingester: readinessProbe: {} # -- liveness probe settings for ingester pods. If empty use `loki.livenessProbe` livenessProbe: {} - persistence: - # -- Enable creating PVCs which is required when using boltdb-shipper - enabled: false - # -- Use emptyDir with ramdisk for storage. **Please note that all data in ingester will be lost on pod restart** - inMemory: false - # -- List of the ingester PVCs - # @notationType -- list - claims: - - name: data - size: 10Gi - # -- Storage class to be used. - # If defined, storageClassName: . - # If set to "-", storageClassName: "", which disables dynamic provisioning. - # If empty or set to null, no storageClassName spec is - # set, choosing the default provisioner (gp2 on AWS, standard on GKE, AWS, and OpenStack). - storageClass: null - # - name: wal - # size: 150Gi + + persistentVolume: + # If true and ingester.statefulSet.enabled is true, + # Ingester will create/use a Persistent Volume Claim + # If false, use emptyDir + # It is advisable to enable volume persistence in ingester to avoid losing metrics. + # + enabled: true + + # Ingester data Persistent Volume Claim annotations + # + annotations: {} + + # Ingester data Persistent Volume access modes + # Must match those of existing PV or dynamic provisioner + # Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ + accessModes: + - ReadWriteOnce + + # Ingester data Persistent Volume size + size: 2Gi + + # Subdirectory of Ingester data Persistent Volume to mount + # Useful if the volume's root directory is not empty + subPath: "" + # -- Enable StatefulSetAutoDeletePVC feature - enableStatefulSetAutoDeletePVC: false + # https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention + enableRetentionPolicy: false whenDeleted: Retain whenScaled: Retain + + # Ingester data Persistent Volume Storage Class + # If defined, storageClassName: + # If set to "-", storageClassName: "", which disables dynamic provisioning + # If undefined (the default) or set to null, no storageClassName spec is + # set, choosing the default provisioner. + # + # A per-zone storageClass configuration in `ingester.zoneAwareReplication.zones[*].storageClass` takes precedence over this field. + # + # storageClass: "-" + # -- Adds the appProtocol field to the ingester service. This allows ingester to work with istio protocol selection. appProtocol: # -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" From 48354cc29e37fe72a21aa0c45c9c42943cc5f03f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:10:42 +0300 Subject: [PATCH 033/124] fix --- .../ingester/statefulset-ingester.yaml | 16 ++++----- production/helm/loki/values.yaml | 34 ++----------------- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 565ce75b0fdb3..b4be152aa5b9a 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -25,14 +25,14 @@ spec: partition: 0 serviceName: {{ include "loki.ingesterFullname" . }}-headless revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} - {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC) }} + {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistentVolume.enableRetentionPolicy) }} {{/* Data on the read nodes is easy to replace, so we want to always delete PVCs to make operation easier, and will rely on re-fetching data when needed. */}} persistentVolumeClaimRetentionPolicy: - whenDeleted: {{ .Values.ingester.persistence.whenDeleted }} - whenScaled: {{ .Values.ingester.persistence.whenScaled }} + whenDeleted: {{ .Values.ingester.persistentVolume.whenDeleted }} + whenScaled: {{ .Values.ingester.persistentVolume.whenScaled }} {{- end }} selector: matchLabels: @@ -172,17 +172,17 @@ spec: {{- with .Values.ingester.extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if not .Values.ingester.persistence.enabled }} + {{- if not .Values.ingester.persistentVolume.enabled }} - name: data emptyDir: { } - {{- else if .Values.ingester.persistence.inMemory }} + {{- else if .Values.ingester.persistentVolume.inMemory }} - name: data - {{- if .Values.ingester.persistence.inMemory }} + {{- if .Values.ingester.persistentVolume.inMemory }} emptyDir: medium: Memory {{- end }} - {{- if .Values.ingester.persistence.size }} - sizeLimit: {{ .Values.ingester.persistence.size }} + {{- if .Values.ingester.persistentVolume.size }} + sizeLimit: {{ .Values.ingester.persistentVolume.size }} {{- end }} {{- else }} volumeClaimTemplates: diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 3541a5a155bba..7c35fca2ab23b 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1763,14 +1763,15 @@ ingester: readinessProbe: {} # -- liveness probe settings for ingester pods. If empty use `loki.livenessProbe` livenessProbe: {} - + persistentVolume: # If true and ingester.statefulSet.enabled is true, # Ingester will create/use a Persistent Volume Claim # If false, use emptyDir # It is advisable to enable volume persistence in ingester to avoid losing metrics. - # enabled: true + # -- Use emptyDir with ramdisk for storage. **Please note that all data in ingester will be lost on pod restart** + inMemory: false # Ingester data Persistent Volume Claim annotations # @@ -1821,35 +1822,6 @@ ingester: enabled: true # -- The percent of replicas in each zone that will be restarted at once. In a value of 0-100 maxUnavailablePct: 33 - # -- zoneA configuration - zoneA: - # -- optionally define a node selector for this zone - nodeSelector: null - # -- optionally define extra affinity rules, by default different zones are not allowed to schedule on the same host - extraAffinity: {} - # -- Specific annotations to add to zone A statefulset - annotations: {} - # -- Specific annotations to add to zone A pods - podAnnotations: {} - zoneB: - # -- optionally define a node selector for this zone - nodeSelector: null - # -- optionally define extra affinity rules, by default different zones are not allowed to schedule on the same host - extraAffinity: {} - # -- Specific annotations to add to zone B statefulset - annotations: {} - # -- Specific annotations to add to zone B pods - podAnnotations: {} - zoneC: - # -- optionally define a node selector for this zone - nodeSelector: null - # -- optionally define extra affinity rules, by default different zones are not allowed to schedule on the same host - extraAffinity: {} - # -- Specific annotations to add to zone C statefulset - annotations: {} - # -- Specific annotations to add to zone C pods - podAnnotations: {} - # -- The migration block allows migrating non zone aware ingesters to zone aware ingesters. migration: enabled: false excludeDefaultZone: false From 97e364e06241b4d4b2b82af205e6526fd749b5ea Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:16:17 +0300 Subject: [PATCH 034/124] fix --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index b4be152aa5b9a..4d0c1156450d4 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -209,6 +209,7 @@ spec: requests: storage: "{{ .Values.ingester.persistentVolume.size }}" {{- end }} + {{- end }} --- {{ end }} {{ end }} From 59d7b8c1106c9f7769cfb01d83fb828a394d90ca Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:17:52 +0300 Subject: [PATCH 035/124] d --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 4d0c1156450d4..b4be152aa5b9a 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -209,7 +209,6 @@ spec: requests: storage: "{{ .Values.ingester.persistentVolume.size }}" {{- end }} - {{- end }} --- {{ end }} {{ end }} From 3c0fe95937e27e2d2829ddccfff0f8ff27ff3552 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:24:59 +0300 Subject: [PATCH 036/124] x --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 2 +- production/helm/loki/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index b4be152aa5b9a..a16950b8d4cb5 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -25,7 +25,7 @@ spec: partition: 0 serviceName: {{ include "loki.ingesterFullname" . }}-headless revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} - {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistentVolume.enableRetentionPolicy) }} + {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistentVolume.enableStatefulSetAutoDeletePVC) }} {{/* Data on the read nodes is easy to replace, so we want to always delete PVCs to make operation easier, and will rely on re-fetching data when needed. diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 7c35fca2ab23b..9907fd080121d 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1792,7 +1792,7 @@ ingester: # -- Enable StatefulSetAutoDeletePVC feature # https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention - enableRetentionPolicy: false + enableStatefulSetAutoDeletePVC: false whenDeleted: Retain whenScaled: Retain From abdfecb4c9d3393a0713d202391c05fef8b0ce44 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:15:07 +0300 Subject: [PATCH 037/124] fix --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index a16950b8d4cb5..fd19ffcd90bf4 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -122,7 +122,7 @@ spec: mountPath: /etc/loki/config - name: runtime-config mountPath: /etc/loki/runtime-config - - name: data + - name: storage mountPath: /var/loki {{- if .Values.enterprise.enabled }} - name: license From f990d6e828f08a170acb280308185b597a2d45b9 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:45:35 +0300 Subject: [PATCH 038/124] fix --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index fd19ffcd90bf4..f1ed956e6a59d 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -23,7 +23,7 @@ spec: updateStrategy: rollingUpdate: partition: 0 - serviceName: {{ include "loki.ingesterFullname" . }}-headless + serviceName: {{ include "loki.resourceName" $args }}-headless revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistentVolume.enableStatefulSetAutoDeletePVC) }} {{/* From f68cb528de1c0954f0969cc3b3690a4ba396834e Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:51:54 +0300 Subject: [PATCH 039/124] a --- .../helm/loki/templates/ingester/service-ingester-headless.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index 3cdc02c1bb7e4..53d2f2f4ec7b5 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -26,4 +26,4 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + {{- include "loki.selectorLabels" $args | nindent 4 }} From 8956d5fad88d778e0752cf0a00df19073aa09b61 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:53:56 +0300 Subject: [PATCH 040/124] a --- .../helm/loki/templates/ingester/service-ingester-headless.yaml | 2 +- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index 53d2f2f4ec7b5..3cdc02c1bb7e4 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -26,4 +26,4 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.selectorLabels" $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index a0dc8a34e9764..06ee86fae6436 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + {{- include "loki.selectorLabels" $args | nindent 4 }} --- {{ end }} From 52d75283d227c2951c1a2f3bb985e8f227ecd16d Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:57:37 +0300 Subject: [PATCH 041/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 06ee86fae6436..3295bba5d98ae 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.selectorLabels" $args | nindent 4 }} + {{- include "loki.resourceName" $args | nindent 4 }} --- {{ end }} From b1b3d4c3466c14e07a377452a14350ec5fb0e17b Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:58:26 +0300 Subject: [PATCH 042/124] - --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 3295bba5d98ae..d76cedb1a8178 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.resourceName" $args | nindent 4 }} + {{ include "loki.resourceName" $args | nindent 4 }} --- {{ end }} From 0a1bb6a75c708f45f5b2ff2fb9e2aad957633ca3 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:59:39 +0300 Subject: [PATCH 043/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index d76cedb1a8178..06ee86fae6436 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{ include "loki.resourceName" $args | nindent 4 }} + {{- include "loki.selectorLabels" $args | nindent 4 }} --- {{ end }} From aa6a8543fb9fed837670f7727ebb6b154768a77a Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:07:25 +0300 Subject: [PATCH 044/124] a --- production/helm/loki/templates/_helpers.tpl | 28 ++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index a8e94d2a364a0..773b8eb9c1b82 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -247,12 +247,34 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* -Selector labels +Service selector labels +Params: + ctx = . context + component = name of the component + rolloutZoneName = rollout zone name (optional) */}} {{- define "loki.selectorLabels" -}} -app.kubernetes.io/name: {{ include "loki.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .ctx.Values.enterprise.legacyLabels }} +{{- if .component -}} +app: {{ include "loki.name" .ctx }}-{{ .component }} +{{- end }} +release: {{ .ctx.Release.Name }} +{{- else -}} +app.kubernetes.io/name: {{ include "loki.name" .ctx }} +app.kubernetes.io/instance: {{ .ctx.Release.Name }} +{{- if .component }} +app.kubernetes.io/component: {{ .component }} {{- end }} +{{- end -}} +{{- if .rolloutZoneName }} +{{- if not .component }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} +{{- end }} +rollout-group: {{ .component }} +zone: {{ .rolloutZoneName }} +{{- end }} +{{- end -}} + {{/* Create the name of the service account to use From 8b75ed1534a545df2dcb3045dbff484eb7e21e83 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:09:53 +0300 Subject: [PATCH 045/124] a --- production/helm/loki/templates/_helpers.tpl | 28 +++------------------ 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 773b8eb9c1b82..a8e94d2a364a0 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -247,34 +247,12 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* -Service selector labels -Params: - ctx = . context - component = name of the component - rolloutZoneName = rollout zone name (optional) +Selector labels */}} {{- define "loki.selectorLabels" -}} -{{- if .ctx.Values.enterprise.legacyLabels }} -{{- if .component -}} -app: {{ include "loki.name" .ctx }}-{{ .component }} -{{- end }} -release: {{ .ctx.Release.Name }} -{{- else -}} -app.kubernetes.io/name: {{ include "loki.name" .ctx }} -app.kubernetes.io/instance: {{ .ctx.Release.Name }} -{{- if .component }} -app.kubernetes.io/component: {{ .component }} +app.kubernetes.io/name: {{ include "loki.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{- end -}} -{{- if .rolloutZoneName }} -{{- if not .component }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} -{{- end }} -rollout-group: {{ .component }} -zone: {{ .rolloutZoneName }} -{{- end }} -{{- end -}} - {{/* Create the name of the service account to use From 3f544ab88c2feee04fe53acd37fcb338029436f5 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:10:38 +0300 Subject: [PATCH 046/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 06ee86fae6436..ff64df5e17005 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,8 +32,8 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.selectorLabels" $args | nindent 4 }} - + {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + --- {{ end }} {{ end }} From 58539e59112f317fd0ed004d456338a31ea54989 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:15:12 +0300 Subject: [PATCH 047/124] a --- production/helm/loki/templates/_helpers.tpl | 27 ++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index a8e94d2a364a0..10c59656e8b08 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -247,12 +247,33 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* -Selector labels +Service selector labels +Params: + ctx = . context + component = name of the component + rolloutZoneName = rollout zone name (optional) */}} {{- define "loki.selectorLabels" -}} -app.kubernetes.io/name: {{ include "loki.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .ctx.Values.enterprise.legacyLabels }} +{{- if .component -}} +app: {{ include "loki.name" .ctx }}-{{ .component }} +{{- end }} +release: {{ .ctx.Release.Name }} +{{- else -}} +app.kubernetes.io/name: {{ include "loki.name" .ctx }} +app.kubernetes.io/instance: {{ .ctx.Release.Name }} +{{- if .component }} +app.kubernetes.io/component: {{ .component }} +{{- end }} +{{- end -}} +{{- if .rolloutZoneName }} +{{- if not .component }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} +{{- end }} +rollout-group: {{ .component }} +zone: {{ .rolloutZoneName }} {{- end }} +{{- end -}} {{/* Create the name of the service account to use From 79b4e97b75a28f007fe318a94173bd4139707a03 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:15:52 +0300 Subject: [PATCH 048/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index ff64df5e17005..06ee86fae6436 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,8 +32,8 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} - + {{- include "loki.selectorLabels" $args | nindent 4 }} + --- {{ end }} {{ end }} From 1a09d68913c36bf1ff1fa862c00528b4b74da0b8 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:17:04 +0300 Subject: [PATCH 049/124] a --- production/helm/loki/templates/_helpers.tpl | 6 ------ 1 file changed, 6 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 10c59656e8b08..501cea271f6b4 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -254,12 +254,6 @@ Params: rolloutZoneName = rollout zone name (optional) */}} {{- define "loki.selectorLabels" -}} -{{- if .ctx.Values.enterprise.legacyLabels }} -{{- if .component -}} -app: {{ include "loki.name" .ctx }}-{{ .component }} -{{- end }} -release: {{ .ctx.Release.Name }} -{{- else -}} app.kubernetes.io/name: {{ include "loki.name" .ctx }} app.kubernetes.io/instance: {{ .ctx.Release.Name }} {{- if .component }} From 2c4b743794726d64fa0f880238632ef18253bcc4 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:17:37 +0300 Subject: [PATCH 050/124] a --- production/helm/loki/templates/_helpers.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 501cea271f6b4..17c7bd3b05d91 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -267,7 +267,6 @@ app.kubernetes.io/component: {{ .component }} rollout-group: {{ .component }} zone: {{ .rolloutZoneName }} {{- end }} -{{- end -}} {{/* Create the name of the service account to use From 8fd040fb68ae2b091d540dd07e8eb62fa1646648 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:17:53 +0300 Subject: [PATCH 051/124] a --- production/helm/loki/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 17c7bd3b05d91..c1065137df9fd 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -266,7 +266,7 @@ app.kubernetes.io/component: {{ .component }} {{- end }} rollout-group: {{ .component }} zone: {{ .rolloutZoneName }} -{{- end }} +{{- end -}} {{/* Create the name of the service account to use From 76d3928d3eab78c3145ab28472d477ea6a1591c7 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:20:14 +0300 Subject: [PATCH 052/124] a --- production/helm/loki/templates/_helpers.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index c1065137df9fd..7194b2620e65e 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -254,7 +254,7 @@ Params: rolloutZoneName = rollout zone name (optional) */}} {{- define "loki.selectorLabels" -}} -app.kubernetes.io/name: {{ include "loki.name" .ctx }} +app.kubernetes.io/name: {{ include "loki.name" . }} app.kubernetes.io/instance: {{ .ctx.Release.Name }} {{- if .component }} app.kubernetes.io/component: {{ .component }} @@ -266,7 +266,7 @@ app.kubernetes.io/component: {{ .component }} {{- end }} rollout-group: {{ .component }} zone: {{ .rolloutZoneName }} -{{- end -}} +{{- end }} {{/* Create the name of the service account to use From 413f56b554cfd642628e76a331a8e0070d8764b2 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:21:50 +0300 Subject: [PATCH 053/124] a --- production/helm/loki/templates/_helpers.tpl | 18 ++---------------- .../templates/ingester/_helpers-ingester.tpl | 7 +++++++ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 7194b2620e65e..a8e94d2a364a0 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -247,25 +247,11 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* -Service selector labels -Params: - ctx = . context - component = name of the component - rolloutZoneName = rollout zone name (optional) +Selector labels */}} {{- define "loki.selectorLabels" -}} app.kubernetes.io/name: {{ include "loki.name" . }} -app.kubernetes.io/instance: {{ .ctx.Release.Name }} -{{- if .component }} -app.kubernetes.io/component: {{ .component }} -{{- end }} -{{- end -}} -{{- if .rolloutZoneName }} -{{- if not .component }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} -{{- end }} -rollout-group: {{ .component }} -zone: {{ .rolloutZoneName }} +app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 418d4094d5ff9..873403cf8fff4 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -19,6 +19,13 @@ ingester selector labels {{- define "loki.ingesterSelectorLabels" -}} {{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester +{{- if .rolloutZoneName }} +{{- if not .component }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} +{{- end }} +rollout-group: {{ .component }} +zone: {{ .rolloutZoneName }} +{{- end }} {{- end }} {{/* From c6c9798c7db15ec4a3bb5e9212b399ece541d0e3 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:22:36 +0300 Subject: [PATCH 054/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 06ee86fae6436..b305d216d6825 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.selectorLabels" $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} --- {{ end }} From e6f3e310aacdc206872580f39ab82fc47c87b698 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:23:03 +0300 Subject: [PATCH 055/124] a --- .../helm/loki/templates/ingester/_helpers-ingester.tpl | 7 ------- 1 file changed, 7 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 873403cf8fff4..418d4094d5ff9 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -19,13 +19,6 @@ ingester selector labels {{- define "loki.ingesterSelectorLabels" -}} {{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester -{{- if .rolloutZoneName }} -{{- if not .component }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} -{{- end }} -rollout-group: {{ .component }} -zone: {{ .rolloutZoneName }} -{{- end }} {{- end }} {{/* From e1b0ca958802d01dda0756cf6a1d65900ce1582c Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:23:12 +0300 Subject: [PATCH 056/124] a --- .../helm/loki/templates/ingester/_helpers-ingester.tpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 418d4094d5ff9..873403cf8fff4 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -19,6 +19,13 @@ ingester selector labels {{- define "loki.ingesterSelectorLabels" -}} {{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester +{{- if .rolloutZoneName }} +{{- if not .component }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} +{{- end }} +rollout-group: {{ .component }} +zone: {{ .rolloutZoneName }} +{{- end }} {{- end }} {{/* From 79c532fd0ce37409decb387a937c8b71677923ed Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:24:06 +0300 Subject: [PATCH 057/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index b305d216d6825..9d9e6f93bb694 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" . $args | nindent 4 }} --- {{ end }} From 0cad68ca14682561c41448d9a75f246870fe71ab Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:28:07 +0300 Subject: [PATCH 058/124] remove space --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 9d9e6f93bb694..4813f6584ae36 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" .$args | nindent 4 }} --- {{ end }} From e08a0f57d719754ac49aaa815ba8e5804ec5ed91 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:28:38 +0300 Subject: [PATCH 059/124] remove dot --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 4813f6584ae36..b305d216d6825 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" .$args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} --- {{ end }} From d9ba49381421a7862c57f160e09170cee9e6107b Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:52:17 +0300 Subject: [PATCH 060/124] a --- production/helm/loki/templates/ingester/_helpers-ingester.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 873403cf8fff4..0925e482fbf21 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -17,8 +17,8 @@ app.kubernetes.io/component: ingester ingester selector labels */}} {{- define "loki.ingesterSelectorLabels" -}} -{{ include "loki.selectorLabels" . }} -app.kubernetes.io/component: ingester +{{ include "loki.selectorLabels" .ctx }} +app.kubernetes.io/component: ingester {{- if .rolloutZoneName }} {{- if not .component }} {{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} From e077bd96f2ff44fe59faf54c2b28ef7b5ab22164 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:55:59 +0300 Subject: [PATCH 061/124] a --- .../loki/templates/ingester/_helpers-ingester.tpl | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 0925e482fbf21..418d4094d5ff9 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -17,15 +17,8 @@ app.kubernetes.io/component: ingester ingester selector labels */}} {{- define "loki.ingesterSelectorLabels" -}} -{{ include "loki.selectorLabels" .ctx }} -app.kubernetes.io/component: ingester -{{- if .rolloutZoneName }} -{{- if not .component }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} -{{- end }} -rollout-group: {{ .component }} -zone: {{ .rolloutZoneName }} -{{- end }} +{{ include "loki.selectorLabels" . }} +app.kubernetes.io/component: ingester {{- end }} {{/* From a66dca1069ed5acfa4b7feaa8a6173f955ad8f3d Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:56:53 +0300 Subject: [PATCH 062/124] remove args and add dot --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index b305d216d6825..a0dc8a34e9764 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} --- {{ end }} From 015fe92cf3685620c5fce026ebc30dce889fb5e3 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:01:50 +0300 Subject: [PATCH 063/124] . --- production/helm/loki/templates/_helpers.tpl | 28 +++++++++++++++++-- .../templates/ingester/service-ingester.yaml | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index a8e94d2a364a0..773b8eb9c1b82 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -247,12 +247,34 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* -Selector labels +Service selector labels +Params: + ctx = . context + component = name of the component + rolloutZoneName = rollout zone name (optional) */}} {{- define "loki.selectorLabels" -}} -app.kubernetes.io/name: {{ include "loki.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .ctx.Values.enterprise.legacyLabels }} +{{- if .component -}} +app: {{ include "loki.name" .ctx }}-{{ .component }} +{{- end }} +release: {{ .ctx.Release.Name }} +{{- else -}} +app.kubernetes.io/name: {{ include "loki.name" .ctx }} +app.kubernetes.io/instance: {{ .ctx.Release.Name }} +{{- if .component }} +app.kubernetes.io/component: {{ .component }} {{- end }} +{{- end -}} +{{- if .rolloutZoneName }} +{{- if not .component }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} +{{- end }} +rollout-group: {{ .component }} +zone: {{ .rolloutZoneName }} +{{- end }} +{{- end -}} + {{/* Create the name of the service account to use diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index a0dc8a34e9764..ea21dbb9b337c 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + {{- include "loki.loki.selectorLabels" $args | nindent 4 }} --- {{ end }} From b579b61f36eb035e99a0723676236a454d31bbc4 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:03:12 +0300 Subject: [PATCH 064/124] . --- production/helm/loki/templates/_helpers.tpl | 11 +++++++++-- .../loki/templates/ingester/service-ingester.yaml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 773b8eb9c1b82..2194268191e8b 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -246,6 +246,14 @@ app.kubernetes.io/version: {{ include "loki.validLabelValue" (.Values.loki.image app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} +{{/* +Selector labels +*/}} +{{- define "loki.selectorLabels" -}} +app.kubernetes.io/name: {{ include "loki.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + {{/* Service selector labels Params: @@ -253,7 +261,7 @@ Params: component = name of the component rolloutZoneName = rollout zone name (optional) */}} -{{- define "loki.selectorLabels" -}} +{{- define "loki.selectorLabelsTest" -}} {{- if .ctx.Values.enterprise.legacyLabels }} {{- if .component -}} app: {{ include "loki.name" .ctx }}-{{ .component }} @@ -275,7 +283,6 @@ zone: {{ .rolloutZoneName }} {{- end }} {{- end -}} - {{/* Create the name of the service account to use */}} diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index ea21dbb9b337c..6413719aa440e 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.loki.selectorLabels" $args | nindent 4 }} + {{- include "loki.selectorLabelsTest" $args | nindent 4 }} --- {{ end }} From f4c18ee1aa2ace77f613f357a1e7c8a86c663d68 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:07:13 +0300 Subject: [PATCH 065/124] . --- production/helm/loki/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 2194268191e8b..94ba8f78b4c7c 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -278,7 +278,7 @@ app.kubernetes.io/component: {{ .component }} {{- if not .component }} {{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} {{- end }} -rollout-group: {{ .component }} +app.kubernetes.io/component: {{ .component }} zone: {{ .rolloutZoneName }} {{- end }} {{- end -}} From a2af48493a959a5a9cee1c4951dc8d22dc58e1ba Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:09:49 +0300 Subject: [PATCH 066/124] . --- production/helm/loki/templates/_helpers.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 94ba8f78b4c7c..e145dab589f62 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -239,7 +239,7 @@ Common labels */}} {{- define "loki.labels" -}} helm.sh/chart: {{ include "loki.chart" . }} -{{ include "loki.selectorLabels" . }} +{{ include "loki.selectorLabelsTest" . }} {{- if or (.Chart.AppVersion) (.Values.loki.image.tag) }} app.kubernetes.io/version: {{ include "loki.validLabelValue" (.Values.loki.image.tag | default .Chart.AppVersion) | quote }} {{- end }} @@ -278,7 +278,7 @@ app.kubernetes.io/component: {{ .component }} {{- if not .component }} {{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} {{- end }} -app.kubernetes.io/component: {{ .component }} +rollout-group: {{ .component }} zone: {{ .rolloutZoneName }} {{- end }} {{- end -}} From e8d4e082f72c1a451faf0e84ad85e82e0e59f39f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:20:22 +0300 Subject: [PATCH 067/124] add ctx to selector --- production/helm/loki/templates/_helpers.tpl | 24 ++++++++------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index e145dab589f62..e53a24989b8ad 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -239,7 +239,7 @@ Common labels */}} {{- define "loki.labels" -}} helm.sh/chart: {{ include "loki.chart" . }} -{{ include "loki.selectorLabelsTest" . }} +{{ include "loki.selectorLabels" . }} {{- if or (.Chart.AppVersion) (.Values.loki.image.tag) }} app.kubernetes.io/version: {{ include "loki.validLabelValue" (.Values.loki.image.tag | default .Chart.AppVersion) | quote }} {{- end }} @@ -261,25 +261,19 @@ Params: component = name of the component rolloutZoneName = rollout zone name (optional) */}} -{{- define "loki.selectorLabelsTest" -}} -{{- if .ctx.Values.enterprise.legacyLabels }} -{{- if .component -}} -app: {{ include "loki.name" .ctx }}-{{ .component }} -{{- end }} -release: {{ .ctx.Release.Name }} -{{- else -}} -app.kubernetes.io/name: {{ include "loki.name" .ctx }} -app.kubernetes.io/instance: {{ .ctx.Release.Name }} + +app.kubernetes.io/name: {{ include "loki.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} {{- if .component }} -app.kubernetes.io/component: {{ .component }} +app.kubernetes.io/component: {{ ctx.component }} {{- end }} {{- end -}} -{{- if .rolloutZoneName }} +{{- if ctx.rolloutZoneName }} {{- if not .component }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" ctx.rolloutZoneName | fail }} {{- end }} -rollout-group: {{ .component }} -zone: {{ .rolloutZoneName }} +rollout-group: {{ ctx.component }} +zone: {{ ctx.rolloutZoneName }} {{- end }} {{- end -}} From 6da398dc12e2278b0a44dbc1cca64c3ad45859fb Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:22:11 +0300 Subject: [PATCH 068/124] / --- production/helm/loki/templates/_helpers.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index e53a24989b8ad..5532a47189007 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -248,11 +248,11 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels -*/}} {{- define "loki.selectorLabels" -}} app.kubernetes.io/name: {{ include "loki.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +*/}} {{/* Service selector labels @@ -261,19 +261,19 @@ Params: component = name of the component rolloutZoneName = rollout zone name (optional) */}} - +{{- define "loki.selectorLabels" -}} app.kubernetes.io/name: {{ include "loki.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- if .component }} -app.kubernetes.io/component: {{ ctx.component }} +app.kubernetes.io/component: {{ .ctx.component }} {{- end }} {{- end -}} {{- if ctx.rolloutZoneName }} {{- if not .component }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" ctx.rolloutZoneName | fail }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .ctx.rolloutZoneName | fail }} {{- end }} -rollout-group: {{ ctx.component }} -zone: {{ ctx.rolloutZoneName }} +rollout-group: {{ .ctx.component }} +zone: {{ .ctx.rolloutZoneName }} {{- end }} {{- end -}} From fe65bd0cf696d0602c1a423bc9b37292a40239a4 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:23:03 +0300 Subject: [PATCH 069/124] a --- production/helm/loki/templates/_helpers.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 5532a47189007..67923432ff905 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -268,12 +268,12 @@ app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: {{ .ctx.component }} {{- end }} {{- end -}} -{{- if ctx.rolloutZoneName }} +{{- if .ctx.rolloutZoneName }} {{- if not .component }} {{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .ctx.rolloutZoneName | fail }} {{- end }} rollout-group: {{ .ctx.component }} -zone: {{ .ctx.rolloutZoneName }} +zone: {{ .ctx..rolloutZoneName }} {{- end }} {{- end -}} From 00becd7e74b4f3db88ae3a170caa97e9eee9555a Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:23:23 +0300 Subject: [PATCH 070/124] . --- production/helm/loki/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 67923432ff905..56cb8e3b38eed 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -273,7 +273,7 @@ app.kubernetes.io/component: {{ .ctx.component }} {{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .ctx.rolloutZoneName | fail }} {{- end }} rollout-group: {{ .ctx.component }} -zone: {{ .ctx..rolloutZoneName }} +zone: {{ .ctx.rolloutZoneName }} {{- end }} {{- end -}} From ab8fc8a6672f8b1cb2cfa3d0bd6f198fd04808a7 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:23:52 +0300 Subject: [PATCH 071/124] - --- production/helm/loki/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 56cb8e3b38eed..c012174f2757f 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -275,7 +275,7 @@ app.kubernetes.io/component: {{ .ctx.component }} rollout-group: {{ .ctx.component }} zone: {{ .ctx.rolloutZoneName }} {{- end }} -{{- end -}} +- {{/* Create the name of the service account to use From 781a5162e8e13706e32e682fbf84a3fc939aaf8d Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:25:45 +0300 Subject: [PATCH 072/124] . --- production/helm/loki/templates/_helpers.tpl | 8 ++------ .../helm/loki/templates/ingester/service-ingester.yaml | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index c012174f2757f..d6ef3d5c18aed 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -264,18 +264,14 @@ Params: {{- define "loki.selectorLabels" -}} app.kubernetes.io/name: {{ include "loki.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .component }} -app.kubernetes.io/component: {{ .ctx.component }} -{{- end }} -{{- end -}} {{- if .ctx.rolloutZoneName }} -{{- if not .component }} +{{- if not .ctxcomponent }} {{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .ctx.rolloutZoneName | fail }} {{- end }} rollout-group: {{ .ctx.component }} zone: {{ .ctx.rolloutZoneName }} {{- end }} -- + {{/* Create the name of the service account to use diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 6413719aa440e..b305d216d6825 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.selectorLabelsTest" $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} --- {{ end }} From bf0efc20c92733c1f1484d33019c32b003f87d97 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:26:21 +0300 Subject: [PATCH 073/124] . --- production/helm/loki/templates/_helpers.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index d6ef3d5c18aed..60b2f15fc34b4 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -271,6 +271,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} rollout-group: {{ .ctx.component }} zone: {{ .ctx.rolloutZoneName }} {{- end }} +{{- end -}} {{/* From aa0129a668033eee7ebfe22bf04ad545a2a381da Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:31:30 +0300 Subject: [PATCH 074/124] . --- production/helm/loki/templates/_helpers.tpl | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 60b2f15fc34b4..a8e94d2a364a0 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -248,31 +248,11 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels -{{- define "loki.selectorLabels" -}} -app.kubernetes.io/name: {{ include "loki.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} -*/}} - -{{/* -Service selector labels -Params: - ctx = . context - component = name of the component - rolloutZoneName = rollout zone name (optional) */}} {{- define "loki.selectorLabels" -}} app.kubernetes.io/name: {{ include "loki.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .ctx.rolloutZoneName }} -{{- if not .ctxcomponent }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .ctx.rolloutZoneName | fail }} -{{- end }} -rollout-group: {{ .ctx.component }} -zone: {{ .ctx.rolloutZoneName }} {{- end }} -{{- end -}} - {{/* Create the name of the service account to use From b0788ef052e3c44fd6e069bee7c19655ce1b6c29 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:33:41 +0300 Subject: [PATCH 075/124] test --- .../loki/templates/ingester/_helpers-ingester.tpl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 418d4094d5ff9..9b9eb2ee51308 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -11,7 +11,15 @@ ingester common labels {{- define "loki.ingesterLabels" -}} {{ include "loki.labels" . }} app.kubernetes.io/component: ingester +{{- if .rolloutZoneName }} +{{- if not .component }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} +{{- end }} +name: "{{ .component }}-{{ .rolloutZoneName }}" {{- /* Currently required for rollout-operator. https://github.com/grafana/rollout-operator/issues/15 */}} +rollout-group: {{ .component }} +zone: {{ .rolloutZoneName }} {{- end }} +{{- end -}} {{/* ingester selector labels @@ -19,7 +27,14 @@ ingester selector labels {{- define "loki.ingesterSelectorLabels" -}} {{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester +{{- if .rolloutZoneName }} +{{- if not .component }} +{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} +{{- end }} +rollout-group: {{ .component }} +zone: {{ .rolloutZoneName }} {{- end }} +{{- end -}} {{/* ingester priority class name From 1438608a9a0b36a5907dc53b901956e15b2ff5b5 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:35:37 +0300 Subject: [PATCH 076/124] . --- .../loki/templates/ingester/_helpers-ingester.tpl | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 9b9eb2ee51308..5fd448fa9b9fd 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -12,14 +12,9 @@ ingester common labels {{ include "loki.labels" . }} app.kubernetes.io/component: ingester {{- if .rolloutZoneName }} -{{- if not .component }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} -{{- end }} -name: "{{ .component }}-{{ .rolloutZoneName }}" {{- /* Currently required for rollout-operator. https://github.com/grafana/rollout-operator/issues/15 */}} -rollout-group: {{ .component }} zone: {{ .rolloutZoneName }} {{- end }} -{{- end -}} +{{- end }} {{/* ingester selector labels @@ -28,13 +23,9 @@ ingester selector labels {{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester {{- if .rolloutZoneName }} -{{- if not .component }} -{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} -{{- end }} -rollout-group: {{ .component }} zone: {{ .rolloutZoneName }} {{- end }} -{{- end -}} +{{- end }} {{/* ingester priority class name From 5f983edf4bac716ea1b618652c1e1522a75705a4 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:37:15 +0300 Subject: [PATCH 077/124] service --- .../helm/loki/templates/ingester/service-ingester-headless.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index 3cdc02c1bb7e4..b4da12a872ac1 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -26,4 +26,4 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} From dca1f4a4053dab3bd993af495fbb44f175c17359 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:38:18 +0300 Subject: [PATCH 078/124] . --- .../helm/loki/templates/ingester/service-ingester-headless.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index b4da12a872ac1..1764c25132837 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -26,4 +26,4 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" (dict "ctx" . "component" "ingester" "memberlist" true) | nindent 4 }} From 7e82c687b204024d9774b733b19984a4c6d4ac61 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:39:48 +0300 Subject: [PATCH 079/124] . --- .../helm/loki/templates/ingester/service-ingester-headless.yaml | 2 +- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index 1764c25132837..3cdc02c1bb7e4 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -26,4 +26,4 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" (dict "ctx" . "component" "ingester" "memberlist" true) | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index b305d216d6825..5e7c558c7fd0b 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" $rolloutZone | nindent 4 }} --- {{ end }} From c40dc85636f66463a6148fa4db0cdb68beca86b7 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:50:24 +0300 Subject: [PATCH 080/124] . --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 5e7c558c7fd0b..a0dc8a34e9764 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" $rolloutZone | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} --- {{ end }} From bf7f5ef325cb85692f75d5dc9990009bb143841c Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:54:52 +0300 Subject: [PATCH 081/124] remove space --- .../helm/loki/templates/ingester/service-ingester-headless.yaml | 2 +- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/service-ingester-headless.yaml b/production/helm/loki/templates/ingester/service-ingester-headless.yaml index 3cdc02c1bb7e4..7973f7fcc65ce 100644 --- a/production/helm/loki/templates/ingester/service-ingester-headless.yaml +++ b/production/helm/loki/templates/ingester/service-ingester-headless.yaml @@ -26,4 +26,4 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index a0dc8a34e9764..87cb80aa31ccc 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" (dict . $rolloutZone) | nindent 4 }} --- {{ end }} From 859c2f6030558a53a5c807d046aad08b390470b2 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:56:29 +0300 Subject: [PATCH 082/124] ctx --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 87cb80aa31ccc..3a28474a9d512 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" (dict . $rolloutZone) | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" .ctx | nindent 4 }} --- {{ end }} From e138b8de370e5731aa3b54edbc6e26c11b004a37 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:39:24 +0300 Subject: [PATCH 083/124] . --- production/helm/loki/templates/_helpers.tpl | 1 + production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index a8e94d2a364a0..60f028f3ca70b 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -254,6 +254,7 @@ app.kubernetes.io/name: {{ include "loki.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} + {{/* Create the name of the service account to use */}} diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 3a28474a9d512..ba2eab76355b2 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" .ctx | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" (dict . $args) | nindent 4 }} --- {{ end }} From 9b91b9ea7970bdcee3303ddd33ee5aad2aaa039e Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:52:55 +0300 Subject: [PATCH 084/124] ., --- production/helm/loki/templates/ingester/service-ingester.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index ba2eab76355b2..2d6703e6ec515 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,6 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: + zone: $rolloutZone {{- include "loki.ingesterSelectorLabels" (dict . $args) | nindent 4 }} --- From d48dcfebe9d42b74381da5fa70cb232bc7949e52 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:53:34 +0300 Subject: [PATCH 085/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 2d6703e6ec515..11223e0e46405 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,7 +33,7 @@ spec: {{- end }} selector: zone: $rolloutZone - {{- include "loki.ingesterSelectorLabels" (dict . $args) | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} --- {{ end }} From b31c2d44671b40a9196f5324d5f5036e707117a6 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:55:37 +0300 Subject: [PATCH 086/124] . --- production/helm/loki/templates/ingester/_helpers-ingester.tpl | 3 --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 5fd448fa9b9fd..0f0160e2cdd54 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -22,9 +22,6 @@ ingester selector labels {{- define "loki.ingesterSelectorLabels" -}} {{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester -{{- if .rolloutZoneName }} -zone: {{ .rolloutZoneName }} -{{- end }} {{- end }} {{/* diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 11223e0e46405..7aca6d25603be 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - zone: $rolloutZone + zone: {{- with .Values.ingester.serviceLabels }} {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} --- From f86e5e5c1a9a8aabf783bb891205d678caf817a5 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:58:00 +0300 Subject: [PATCH 087/124] . --- production/helm/loki/templates/ingester/_helpers-ingester.tpl | 3 --- production/helm/loki/templates/ingester/service-ingester.yaml | 1 - 2 files changed, 4 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 0f0160e2cdd54..418d4094d5ff9 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -11,9 +11,6 @@ ingester common labels {{- define "loki.ingesterLabels" -}} {{ include "loki.labels" . }} app.kubernetes.io/component: ingester -{{- if .rolloutZoneName }} -zone: {{ .rolloutZoneName }} -{{- end }} {{- end }} {{/* diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 7aca6d25603be..a0dc8a34e9764 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -32,7 +32,6 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - zone: {{- with .Values.ingester.serviceLabels }} {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} --- From d2f488f9b815d53a434a13d00b8c37880b7227ac Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:47:13 +0300 Subject: [PATCH 088/124] fix comments on values file --- production/helm/loki/values.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 9907fd080121d..89d2f9f5f99a4 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1765,10 +1765,7 @@ ingester: livenessProbe: {} persistentVolume: - # If true and ingester.statefulSet.enabled is true, - # Ingester will create/use a Persistent Volume Claim - # If false, use emptyDir - # It is advisable to enable volume persistence in ingester to avoid losing metrics. + # -- Enable creating PVCs which is required when using boltdb-shipper enabled: true # -- Use emptyDir with ramdisk for storage. **Please note that all data in ingester will be lost on pod restart** inMemory: false @@ -1786,12 +1783,7 @@ ingester: # Ingester data Persistent Volume size size: 2Gi - # Subdirectory of Ingester data Persistent Volume to mount - # Useful if the volume's root directory is not empty - subPath: "" - # -- Enable StatefulSetAutoDeletePVC feature - # https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention enableStatefulSetAutoDeletePVC: false whenDeleted: Retain whenScaled: Retain From f81bd6d790aaa4e78a01655f279a663f6795e00e Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:17:58 +0300 Subject: [PATCH 089/124] test --- .../helm/loki/templates/ingester/_helpers-ingester.tpl | 6 ++++-- .../helm/loki/templates/ingester/service-ingester.yaml | 4 ++-- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 418d4094d5ff9..8f4b942978652 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -9,16 +9,18 @@ ingester fullname ingester common labels */}} {{- define "loki.ingesterLabels" -}} -{{ include "loki.labels" . }} +{{ include "loki.labels" .ctx. }} app.kubernetes.io/component: ingester +zone: {{ .rolloutZoneName }} {{- end }} {{/* ingester selector labels */}} {{- define "loki.ingesterSelectorLabels" -}} -{{ include "loki.selectorLabels" . }} +{{ include "loki.selectorLabels" .ctx. }} app.kubernetes.io/component: ingester +zone: {{ .rolloutZoneName }} {{- end }} {{/* diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index a0dc8a34e9764..88cb0f10d33d6 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -9,7 +9,7 @@ metadata: name: {{ include "loki.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: - {{- include "loki.ingesterLabels" . | nindent 4 }} + {{- include "loki.ingesterLabels" $args | nindent 4 }} {{- with .Values.ingester.serviceLabels }} {{- toYaml . | nindent 4 }} {{- end }} @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} --- {{ end }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index f1ed956e6a59d..0630067cfafe6 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -9,7 +9,7 @@ metadata: name: {{ include "loki.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: - {{- include "loki.ingesterLabels" . | nindent 4 }} + {{- include "loki.ingesterLabels" $args | nindent 4 }} app.kubernetes.io/part-of: memberlist {{- with .Values.loki.annotations }} annotations: @@ -36,7 +36,7 @@ spec: {{- end }} selector: matchLabels: - {{- include "loki.ingesterSelectorLabels" . | nindent 6 }} + {{- include "loki.ingesterSelectorLabels" $args | nindent 6 }} template: metadata: annotations: @@ -48,7 +48,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} + {{- include "loki.ingesterSelectorLabels" $args | nindent 8 }} app.kubernetes.io/part-of: memberlist {{- with .Values.loki.podLabels }} {{- toYaml . | nindent 8 }} From 44dfecd2ea3e66dc3c9cef16a5e1fab5c2b18fc7 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:18:48 +0300 Subject: [PATCH 090/124] test --- production/helm/loki/templates/ingester/_helpers-ingester.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 8f4b942978652..e614d1da2cef3 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -9,7 +9,7 @@ ingester fullname ingester common labels */}} {{- define "loki.ingesterLabels" -}} -{{ include "loki.labels" .ctx. }} +{{ include "loki.labels" .ctx }} app.kubernetes.io/component: ingester zone: {{ .rolloutZoneName }} {{- end }} @@ -18,7 +18,7 @@ zone: {{ .rolloutZoneName }} ingester selector labels */}} {{- define "loki.ingesterSelectorLabels" -}} -{{ include "loki.selectorLabels" .ctx. }} +{{ include "loki.selectorLabels" .ctx }} app.kubernetes.io/component: ingester zone: {{ .rolloutZoneName }} {{- end }} From 07eabf404f8aa3ea7dfea17182cca6baf8bfc883 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:28:09 +0300 Subject: [PATCH 091/124] test --- production/helm/loki/templates/ingester/_helpers-ingester.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index e614d1da2cef3..3a1a9ed9a9e9d 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -9,7 +9,7 @@ ingester fullname ingester common labels */}} {{- define "loki.ingesterLabels" -}} -{{ include "loki.labels" .ctx }} +{{ include "loki.labels" . }} app.kubernetes.io/component: ingester zone: {{ .rolloutZoneName }} {{- end }} @@ -18,7 +18,7 @@ zone: {{ .rolloutZoneName }} ingester selector labels */}} {{- define "loki.ingesterSelectorLabels" -}} -{{ include "loki.selectorLabels" .ctx }} +{{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester zone: {{ .rolloutZoneName }} {{- end }} From 491f16c4f8d851c54a65e113f3b09dd7c137e03a Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:33:49 +0300 Subject: [PATCH 092/124] a --- production/helm/loki/templates/_helpers.tpl | 1 + production/helm/loki/templates/ingester/_helpers-ingester.tpl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 60f028f3ca70b..79144ee192b00 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -255,6 +255,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} + {{/* Create the name of the service account to use */}} diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 3a1a9ed9a9e9d..e614d1da2cef3 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -9,7 +9,7 @@ ingester fullname ingester common labels */}} {{- define "loki.ingesterLabels" -}} -{{ include "loki.labels" . }} +{{ include "loki.labels" .ctx }} app.kubernetes.io/component: ingester zone: {{ .rolloutZoneName }} {{- end }} @@ -18,7 +18,7 @@ zone: {{ .rolloutZoneName }} ingester selector labels */}} {{- define "loki.ingesterSelectorLabels" -}} -{{ include "loki.selectorLabels" . }} +{{ include "loki.selectorLabels" .ctx }} app.kubernetes.io/component: ingester zone: {{ .rolloutZoneName }} {{- end }} From eead4d0bcc5ac2696c8e8aed365fa59cc95a2e82 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:49:21 +0300 Subject: [PATCH 093/124] a --- production/helm/loki/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 79144ee192b00..65c8b90976d75 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -250,7 +250,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} Selector labels */}} {{- define "loki.selectorLabels" -}} -app.kubernetes.io/name: {{ include "loki.name" . }} +app.kubernetes.io/name: {{ include "loki.name" .ctx }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} From ca1893e85268e6423e0f4df7260869226899479f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:51:46 +0300 Subject: [PATCH 094/124] / --- production/helm/loki/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 65c8b90976d75..79144ee192b00 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -250,7 +250,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} Selector labels */}} {{- define "loki.selectorLabels" -}} -app.kubernetes.io/name: {{ include "loki.name" .ctx }} +app.kubernetes.io/name: {{ include "loki.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} From f1d7e3a019c95aed397ac62648a2c4d258aeb954 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:53:30 +0300 Subject: [PATCH 095/124] c --- production/helm/loki/templates/ingester/_helpers-ingester.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index e614d1da2cef3..3a1a9ed9a9e9d 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -9,7 +9,7 @@ ingester fullname ingester common labels */}} {{- define "loki.ingesterLabels" -}} -{{ include "loki.labels" .ctx }} +{{ include "loki.labels" . }} app.kubernetes.io/component: ingester zone: {{ .rolloutZoneName }} {{- end }} @@ -18,7 +18,7 @@ zone: {{ .rolloutZoneName }} ingester selector labels */}} {{- define "loki.ingesterSelectorLabels" -}} -{{ include "loki.selectorLabels" .ctx }} +{{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester zone: {{ .rolloutZoneName }} {{- end }} From c034b2447aee7de34d85b776de505fe804d7e716 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:57:11 +0300 Subject: [PATCH 096/124] , --- .../helm/loki/templates/ingester/service-ingester.yaml | 4 ++-- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 88cb0f10d33d6..c80273541461b 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -9,7 +9,7 @@ metadata: name: {{ include "loki.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: - {{- include "loki.ingesterLabels" $args | nindent 4 }} + {{- include "loki.ingesterLabels" $rolloutZone | nindent 4 }} {{- with .Values.ingester.serviceLabels }} {{- toYaml . | nindent 4 }} {{- end }} @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" $args | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" $rolloutZone | nindent 4 }} --- {{ end }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 0630067cfafe6..464391846e3cd 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -9,7 +9,7 @@ metadata: name: {{ include "loki.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: - {{- include "loki.ingesterLabels" $args | nindent 4 }} + {{- include "loki.ingesterLabels" $rolloutZone | nindent 4 }} app.kubernetes.io/part-of: memberlist {{- with .Values.loki.annotations }} annotations: @@ -36,7 +36,7 @@ spec: {{- end }} selector: matchLabels: - {{- include "loki.ingesterSelectorLabels" $args | nindent 6 }} + {{- include "loki.ingesterSelectorLabels" $rolloutZone | nindent 6 }} template: metadata: annotations: @@ -48,7 +48,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.ingesterSelectorLabels" $args | nindent 8 }} + {{- include "loki.ingesterSelectorLabels" $rolloutZone | nindent 8 }} app.kubernetes.io/part-of: memberlist {{- with .Values.loki.podLabels }} {{- toYaml . | nindent 8 }} From 6d4deab5d126e1e1811740c05b4105166ff90915 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:58:45 +0300 Subject: [PATCH 097/124] . --- .../helm/loki/templates/ingester/service-ingester.yaml | 4 ++-- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index c80273541461b..a0dc8a34e9764 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -9,7 +9,7 @@ metadata: name: {{ include "loki.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: - {{- include "loki.ingesterLabels" $rolloutZone | nindent 4 }} + {{- include "loki.ingesterLabels" . | nindent 4 }} {{- with .Values.ingester.serviceLabels }} {{- toYaml . | nindent 4 }} {{- end }} @@ -32,7 +32,7 @@ spec: appProtocol: {{ .Values.ingester.appProtocol.grpc }} {{- end }} selector: - {{- include "loki.ingesterSelectorLabels" $rolloutZone | nindent 4 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} --- {{ end }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 464391846e3cd..f1ed956e6a59d 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -9,7 +9,7 @@ metadata: name: {{ include "loki.resourceName" $args }} namespace: {{ .Release.Namespace }} labels: - {{- include "loki.ingesterLabels" $rolloutZone | nindent 4 }} + {{- include "loki.ingesterLabels" . | nindent 4 }} app.kubernetes.io/part-of: memberlist {{- with .Values.loki.annotations }} annotations: @@ -36,7 +36,7 @@ spec: {{- end }} selector: matchLabels: - {{- include "loki.ingesterSelectorLabels" $rolloutZone | nindent 6 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 6 }} template: metadata: annotations: @@ -48,7 +48,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.ingesterSelectorLabels" $rolloutZone | nindent 8 }} + {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist {{- with .Values.loki.podLabels }} {{- toYaml . | nindent 8 }} From b28d0c48de02e6bb55dc664ee295edab161347eb Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:39:06 +0300 Subject: [PATCH 098/124] test --- production/helm/loki/templates/ingester/service-ingester.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index a0dc8a34e9764..acac2f6938f3a 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,6 +33,7 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + test: {{ include "mimir.resourceName" $args }} --- {{ end }} From dc319319e0d280700165d7e2e51cbb88a4c0ab5f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:39:50 +0300 Subject: [PATCH 099/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index acac2f6938f3a..f174edc7f0f44 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,7 +33,7 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} - test: {{ include "mimir.resourceName" $args }} + test: {{ include "loki.resourceName" $args }} --- {{ end }} From 71627feb88bd84a75a0a115c7002084cb7d6d7a1 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:42:32 +0300 Subject: [PATCH 100/124] fix --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index f174edc7f0f44..af48a926268de 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,7 +33,7 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} - test: {{ include "loki.resourceName" $args }} + statefulset.kubernetes.io/pod-name: {{ include "loki.resourceName" $args }}-* --- {{ end }} From 9125ae382381d995df99378093307e814206509e Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:43:20 +0300 Subject: [PATCH 101/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index af48a926268de..bc4b081a36ede 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,7 +33,7 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} - statefulset.kubernetes.io/pod-name: {{ include "loki.resourceName" $args }}-* + statefulset.kubernetes.io/pod-name: {{ include "loki.resourceName" $args }}-[0-9] --- {{ end }} From 7f6959a842b5ac5b3d141a8118319c945dc92848 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:43:28 +0300 Subject: [PATCH 102/124] a --- production/helm/loki/templates/ingester/service-ingester.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index bc4b081a36ede..c459ddffadaaf 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -34,7 +34,6 @@ spec: selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} statefulset.kubernetes.io/pod-name: {{ include "loki.resourceName" $args }}-[0-9] - --- {{ end }} {{ end }} From d987f49dc021927faa6cfaf3c37cd3b710f747af Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:44:39 +0300 Subject: [PATCH 103/124] remove test --- production/helm/loki/templates/ingester/service-ingester.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index c459ddffadaaf..1fbf72aee8350 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,7 +33,6 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} - statefulset.kubernetes.io/pod-name: {{ include "loki.resourceName" $args }}-[0-9] --- {{ end }} {{ end }} From 758e107265f647ead5f24732c39dfbd737952bec Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:52:24 +0300 Subject: [PATCH 104/124] try --- production/helm/loki/templates/ingester/service-ingester.yaml | 1 + .../helm/loki/templates/ingester/statefulset-ingester.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml index 1fbf72aee8350..e27b0437d2bac 100644 --- a/production/helm/loki/templates/ingester/service-ingester.yaml +++ b/production/helm/loki/templates/ingester/service-ingester.yaml @@ -33,6 +33,7 @@ spec: {{- end }} selector: {{- include "loki.ingesterSelectorLabels" . | nindent 4 }} + name: {{ include "loki.resourceName" $args }} --- {{ end }} {{ end }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index f1ed956e6a59d..7ddb0c954423f 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -11,6 +11,7 @@ metadata: labels: {{- include "loki.ingesterLabels" . | nindent 4 }} app.kubernetes.io/part-of: memberlist + name: {{ include "loki.resourceName" $args }} {{- with .Values.loki.annotations }} annotations: {{- toYaml . | nindent 4 }} From 2a89d1f6004592f7b818d03aafdbb05ec93d6adf Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:53:48 +0300 Subject: [PATCH 105/124] try --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index 7ddb0c954423f..c7f4a65527523 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -51,6 +51,7 @@ spec: labels: {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist + name: {{ include "loki.resourceName" $args }} {{- with .Values.loki.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} From 9adf447877de91d226721ecd22cb48b73985e1b8 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:31:15 +0300 Subject: [PATCH 106/124] a --- production/helm/loki/templates/ingester/_helpers-ingester.tpl | 2 -- 1 file changed, 2 deletions(-) diff --git a/production/helm/loki/templates/ingester/_helpers-ingester.tpl b/production/helm/loki/templates/ingester/_helpers-ingester.tpl index 3a1a9ed9a9e9d..418d4094d5ff9 100644 --- a/production/helm/loki/templates/ingester/_helpers-ingester.tpl +++ b/production/helm/loki/templates/ingester/_helpers-ingester.tpl @@ -11,7 +11,6 @@ ingester common labels {{- define "loki.ingesterLabels" -}} {{ include "loki.labels" . }} app.kubernetes.io/component: ingester -zone: {{ .rolloutZoneName }} {{- end }} {{/* @@ -20,7 +19,6 @@ ingester selector labels {{- define "loki.ingesterSelectorLabels" -}} {{ include "loki.selectorLabels" . }} app.kubernetes.io/component: ingester -zone: {{ .rolloutZoneName }} {{- end }} {{/* From b33b0756c53993856aac078bef7d9ce0465b153f Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:33:17 +0300 Subject: [PATCH 107/124] . --- production/helm/loki/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 89d2f9f5f99a4..15fc22d75b6ef 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1760,7 +1760,8 @@ ingester: # -- Tolerations for ingester pods tolerations: [] # -- readiness probe settings for ingester pods. If empty, use `loki.readinessProbe` - readinessProbe: {} + readinessProbe: + initialDelaySeconds: 60 # -- liveness probe settings for ingester pods. If empty use `loki.livenessProbe` livenessProbe: {} From fc3c5efb7db5050c1519ee3b5ddd390808e3747b Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:36:55 +0300 Subject: [PATCH 108/124] try --- production/helm/loki/values.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 15fc22d75b6ef..95547cd39129e 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -42,7 +42,7 @@ loki: httpGet: path: /ready port: http-metrics - initialDelaySeconds: 30 + initialDelaySeconds: 60 timeoutSeconds: 1 image: # -- The Docker registry @@ -1760,8 +1760,7 @@ ingester: # -- Tolerations for ingester pods tolerations: [] # -- readiness probe settings for ingester pods. If empty, use `loki.readinessProbe` - readinessProbe: - initialDelaySeconds: 60 + readinessProbe: {} # -- liveness probe settings for ingester pods. If empty use `loki.livenessProbe` livenessProbe: {} From ff67318961385c1964164fa47f89cfef94c38d9d Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:39:10 +0300 Subject: [PATCH 109/124] changed back readinessProbe --- production/helm/loki/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 95547cd39129e..89d2f9f5f99a4 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -42,7 +42,7 @@ loki: httpGet: path: /ready port: http-metrics - initialDelaySeconds: 60 + initialDelaySeconds: 30 timeoutSeconds: 1 image: # -- The Docker registry From 6a230d0abe5eeb8d27c0bad915350ec1aad036b2 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:52:12 +0300 Subject: [PATCH 110/124] creating PVCs - default false --- production/helm/loki/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 89d2f9f5f99a4..7262d1d33fdb9 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1766,7 +1766,7 @@ ingester: persistentVolume: # -- Enable creating PVCs which is required when using boltdb-shipper - enabled: true + enabled: false # -- Use emptyDir with ramdisk for storage. **Please note that all data in ingester will be lost on pod restart** inMemory: false From 51d18ed1546f6c7a55a2bd608c3f20ca8287adcb Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:37:21 +0300 Subject: [PATCH 111/124] . --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index c7f4a65527523..ef1983e122be8 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -18,7 +18,7 @@ metadata: {{- end }} spec: {{- if not .Values.ingester.autoscaling.enabled }} - replicas: {{ $rolloutZone.replicas }} + replicas: {{ include "loki.ingester.replicaCount" . }} {{- end }} podManagementPolicy: Parallel updateStrategy: From 70fa0fb0c85601d2328b6508142aba23d2a30e5c Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:45:12 +0300 Subject: [PATCH 112/124] change --- .../helm/loki/templates/ingester/statefulset-ingester.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index ef1983e122be8..c7f4a65527523 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -18,7 +18,7 @@ metadata: {{- end }} spec: {{- if not .Values.ingester.autoscaling.enabled }} - replicas: {{ include "loki.ingester.replicaCount" . }} + replicas: {{ $rolloutZone.replicas }} {{- end }} podManagementPolicy: Parallel updateStrategy: From 8abc50c51cfcf58cfe15be79ea04cee61e0010f3 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:58:35 +0300 Subject: [PATCH 113/124] true --- production/helm/loki/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 7262d1d33fdb9..89d2f9f5f99a4 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1766,7 +1766,7 @@ ingester: persistentVolume: # -- Enable creating PVCs which is required when using boltdb-shipper - enabled: false + enabled: true # -- Use emptyDir with ramdisk for storage. **Please note that all data in ingester will be lost on pod restart** inMemory: false From 5aa88fc6da3cf533a8de9c2a00f0937354ba0f67 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:45:27 +0300 Subject: [PATCH 114/124] add components to components list --- production/helm/loki/templates/_helpers.tpl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 79144ee192b00..32569def0377c 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -58,7 +58,24 @@ Examples: */}} {{- define "loki.componentSectionFromName" -}} {{- $componentsMap := dict + "admin-api" "adminApi" + "bloom-compactor" "bloomCompactor" + "bloom-gateway" "bloomGateway" + "chunks-cache" "chunksCache" + "compactor" "compactor" + "distributor" "distributor" + "gateway" "gateway" + "index-gateway" "indexGateway" "ingester" "ingester" + "memcached" "memcached" + "pattern-ingester" "patternIngester" + "querier" "querier" + "query-frontend" "queryFrontend" + "query-scheduler" "queryScheduler" + "results-cache" "resultsCache" + "ruler" "ruler" + "single-binary" "singleBinary" + -}} {{- $componentSection := index $componentsMap .component -}} {{- if not $componentSection -}}{{- printf "No component section mapping for %s not found in values; submit a bug report if you are a user, edit loki.componentSectionFromName if you are a contributor" .component | fail -}}{{- end -}} From e909a23794c19bf2509f0d077a108982b2890200 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:45:43 +0300 Subject: [PATCH 115/124] remove space char --- production/helm/loki/templates/_helpers.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 32569def0377c..148c8e1b4bcd4 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -75,7 +75,6 @@ Examples: "results-cache" "resultsCache" "ruler" "ruler" "single-binary" "singleBinary" - -}} {{- $componentSection := index $componentsMap .component -}} {{- if not $componentSection -}}{{- printf "No component section mapping for %s not found in values; submit a bug report if you are a user, edit loki.componentSectionFromName if you are a contributor" .component | fail -}}{{- end -}} From 36b9a74577d5b034b7e1edfacd7413d4f544126a Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:03:45 +0300 Subject: [PATCH 116/124] added more components --- production/helm/loki/templates/_helpers.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 148c8e1b4bcd4..8c48985713daf 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -59,6 +59,7 @@ Examples: {{- define "loki.componentSectionFromName" -}} {{- $componentsMap := dict "admin-api" "adminApi" + "backend" "backend" "bloom-compactor" "bloomCompactor" "bloom-gateway" "bloomGateway" "chunks-cache" "chunksCache" @@ -72,9 +73,11 @@ Examples: "querier" "querier" "query-frontend" "queryFrontend" "query-scheduler" "queryScheduler" + "read" "read" "results-cache" "resultsCache" "ruler" "ruler" "single-binary" "singleBinary" + "write" "write" -}} {{- $componentSection := index $componentsMap .component -}} {{- if not $componentSection -}}{{- printf "No component section mapping for %s not found in values; submit a bug report if you are a user, edit loki.componentSectionFromName if you are a contributor" .component | fail -}}{{- end -}} From 4124548b812f0d4f931f3a69980a0b5d2ef5abac Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:20:45 +0300 Subject: [PATCH 117/124] changed persistentVolume to persistence --- .../ingester/statefulset-ingester.yaml | 26 +++++++++---------- production/helm/loki/values.yaml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index c7f4a65527523..a2fceab356b94 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -26,14 +26,14 @@ spec: partition: 0 serviceName: {{ include "loki.resourceName" $args }}-headless revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} - {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistentVolume.enableStatefulSetAutoDeletePVC) }} + {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC) }} {{/* Data on the read nodes is easy to replace, so we want to always delete PVCs to make operation easier, and will rely on re-fetching data when needed. */}} persistentVolumeClaimRetentionPolicy: - whenDeleted: {{ .Values.ingester.persistentVolume.whenDeleted }} - whenScaled: {{ .Values.ingester.persistentVolume.whenScaled }} + whenDeleted: {{ .Values.ingester.persistence.whenDeleted }} + whenScaled: {{ .Values.ingester.persistence.whenScaled }} {{- end }} selector: matchLabels: @@ -174,17 +174,17 @@ spec: {{- with .Values.ingester.extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if not .Values.ingester.persistentVolume.enabled }} + {{- if not .Values.ingester.persistence.enabled }} - name: data emptyDir: { } - {{- else if .Values.ingester.persistentVolume.inMemory }} + {{- else if .Values.ingester.persistence.inMemory }} - name: data - {{- if .Values.ingester.persistentVolume.inMemory }} + {{- if .Values.ingester.persistence.inMemory }} emptyDir: medium: Memory {{- end }} - {{- if .Values.ingester.persistentVolume.size }} - sizeLimit: {{ .Values.ingester.persistentVolume.size }} + {{- if .Values.ingester.persistence.size }} + sizeLimit: {{ .Values.ingester.persistence.size }} {{- end }} {{- else }} volumeClaimTemplates: @@ -192,12 +192,12 @@ spec: kind: PersistentVolumeClaim metadata: name: storage - {{- if .Values.ingester.persistentVolume.annotations }} + {{- if .Values.ingester.persistence.annotations }} annotations: - {{- toYaml .Values.ingester.persistentVolume.annotations | nindent 10 }} + {{- toYaml .Values.ingester.persistence.annotations | nindent 10 }} {{- end }} spec: - {{- $storageClass := default .Values.ingester.persistentVolume.storageClass $rolloutZone.storageClass }} + {{- $storageClass := default .Values.ingester.persistence.storageClass $rolloutZone.storageClass }} {{- if $storageClass }} {{- if (eq "-" $storageClass) }} storageClassName: "" @@ -206,10 +206,10 @@ spec: {{- end }} {{- end }} accessModes: - {{- toYaml .Values.ingester.persistentVolume.accessModes | nindent 10 }} + {{- toYaml .Values.ingester.persistence.accessModes | nindent 10 }} resources: requests: - storage: "{{ .Values.ingester.persistentVolume.size }}" + storage: "{{ .Values.ingester.persistence.size }}" {{- end }} --- {{ end }} diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 89d2f9f5f99a4..e97488cd1eb3a 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1764,7 +1764,7 @@ ingester: # -- liveness probe settings for ingester pods. If empty use `loki.livenessProbe` livenessProbe: {} - persistentVolume: + persistence: # -- Enable creating PVCs which is required when using boltdb-shipper enabled: true # -- Use emptyDir with ramdisk for storage. **Please note that all data in ingester will be lost on pod restart** From c032fb400e0493e33ab0cf2ac91b1cae4c774123 Mon Sep 17 00:00:00 2001 From: ohad2b Date: Thu, 26 Sep 2024 10:23:01 +0300 Subject: [PATCH 118/124] Update _helpers.tpl --- production/helm/loki/templates/_helpers.tpl | 2 -- 1 file changed, 2 deletions(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index 8c48985713daf..0ddd36fd0f043 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -273,8 +273,6 @@ app.kubernetes.io/name: {{ include "loki.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} - - {{/* Create the name of the service account to use */}} From 8ca805977ef778ab21d9d7518fff258ab574020e Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:17:07 +0300 Subject: [PATCH 119/124] fixes --- .../ingester/statefulset-ingester.yaml | 12 ++-- production/helm/loki/values.yaml | 70 ++++++++++++++++++- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index a2fceab356b94..18e2c37e82a5c 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -124,7 +124,7 @@ spec: mountPath: /etc/loki/config - name: runtime-config mountPath: /etc/loki/runtime-config - - name: storage + - name: data mountPath: /var/loki {{- if .Values.enterprise.enabled }} - name: license @@ -144,14 +144,14 @@ spec: {{- if .Values.ingester.extraContainers }} {{- toYaml .Values.ingester.extraContainers | nindent 8}} {{- end }} - {{- with $rolloutZone.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} {{- with $rolloutZone.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} + {{- with $rolloutZone.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.ingester.tolerations }} tolerations: {{- toYaml . | nindent 8 }} @@ -191,7 +191,7 @@ spec: - apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: storage + name: data {{- if .Values.ingester.persistence.annotations }} annotations: {{- toYaml .Values.ingester.persistence.annotations | nindent 10 }} diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index e138a4ec99820..2c959f47e4617 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1767,10 +1767,9 @@ ingester: readinessProbe: {} # -- liveness probe settings for ingester pods. If empty use `loki.livenessProbe` livenessProbe: {} - persistence: # -- Enable creating PVCs which is required when using boltdb-shipper - enabled: true + enabled: false # -- Use emptyDir with ramdisk for storage. **Please note that all data in ingester will be lost on pod restart** inMemory: false @@ -1802,6 +1801,73 @@ ingester: # # storageClass: "-" + # -- Options to configure zone-aware replication for ingester + # Example configuration with full geographical redundancy: + # rollout_operator: + # enabled: true + # ingester: + # zoneAwareReplication: + # enabled: true + # topologyKey: 'kubernetes.io/hostname' # This generates default anti-affinity rules + # zones: # Zone list has to be fully redefined for modification. Update with you actual zones or skip to use logical zones only. + # - name: zone-a + # nodeSelector: + # topology.kubernetes.io/zone: us-central1-a + # storageClass: storage-class-us-central1-a + # - name: zone-a + # nodeSelector: + # topology.kubernetes.io/zone: us-central1-b + # storageClass: storage-class-us-central1-b + # - name: zone-c + # nodeSelector: + # topology.kubernetes.io/zone: us-central1-c + # storageClass: storage-class-us-central1-c + # + zoneAwareReplication: + # -- Enable zone-aware replication for ingester + enabled: true + # -- Zone definitions for ingester zones. Note: you have to redefine the whole list to change parts as YAML does not allow to modify parts of a list. + zones: + # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + - name: zone-a + # -- nodeselector to restrict where pods of this zone can be placed. E.g.: + # nodeSelector: + # topology.kubernetes.io/zone: zone-a + nodeSelector: null + # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) + extraAffinity: {} + # -- Ingester data Persistent Volume Storage Class + # If defined, storageClassName: + # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning + # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. + storageClass: null + # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + - name: zone-b + # -- nodeselector to restrict where pods of this zone can be placed. E.g.: + # nodeSelector: + # topology.kubernetes.io/zone: zone-b + nodeSelector: null + # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) + extraAffinity: {} + # -- Ingester data Persistent Volume Storage Class + # If defined, storageClassName: + # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning + # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. + storageClass: null + # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + - name: zone-c + # -- nodeselector to restrict where pods of this zone can be placed. E.g.: + # nodeSelector: + # topology.kubernetes.io/zone: zone-c + nodeSelector: null + # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) + extraAffinity: {} + # -- Ingester data Persistent Volume Storage Class + # If defined, storageClassName: + # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning + # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. + storageClass: null + # -- Adds the appProtocol field to the ingester service. This allows ingester to work with istio protocol selection. appProtocol: # -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" From 8b0e03f7b6160967b71612ed79da1c6e1f42c011 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:22:47 +0300 Subject: [PATCH 120/124] fix --- production/helm/loki/values.yaml | 132 +++++++++++++++---------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 2c959f47e4617..6bf018815b1bc 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1801,72 +1801,72 @@ ingester: # # storageClass: "-" - # -- Options to configure zone-aware replication for ingester - # Example configuration with full geographical redundancy: - # rollout_operator: - # enabled: true - # ingester: - # zoneAwareReplication: - # enabled: true - # topologyKey: 'kubernetes.io/hostname' # This generates default anti-affinity rules - # zones: # Zone list has to be fully redefined for modification. Update with you actual zones or skip to use logical zones only. - # - name: zone-a - # nodeSelector: - # topology.kubernetes.io/zone: us-central1-a - # storageClass: storage-class-us-central1-a - # - name: zone-a - # nodeSelector: - # topology.kubernetes.io/zone: us-central1-b - # storageClass: storage-class-us-central1-b - # - name: zone-c - # nodeSelector: - # topology.kubernetes.io/zone: us-central1-c - # storageClass: storage-class-us-central1-c - # - zoneAwareReplication: - # -- Enable zone-aware replication for ingester - enabled: true - # -- Zone definitions for ingester zones. Note: you have to redefine the whole list to change parts as YAML does not allow to modify parts of a list. - zones: - # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - - name: zone-a - # -- nodeselector to restrict where pods of this zone can be placed. E.g.: - # nodeSelector: - # topology.kubernetes.io/zone: zone-a - nodeSelector: null - # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) - extraAffinity: {} - # -- Ingester data Persistent Volume Storage Class - # If defined, storageClassName: - # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning - # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. - storageClass: null - # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - - name: zone-b - # -- nodeselector to restrict where pods of this zone can be placed. E.g.: - # nodeSelector: - # topology.kubernetes.io/zone: zone-b - nodeSelector: null - # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) - extraAffinity: {} - # -- Ingester data Persistent Volume Storage Class - # If defined, storageClassName: - # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning - # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. - storageClass: null - # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - - name: zone-c - # -- nodeselector to restrict where pods of this zone can be placed. E.g.: - # nodeSelector: - # topology.kubernetes.io/zone: zone-c - nodeSelector: null - # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) - extraAffinity: {} - # -- Ingester data Persistent Volume Storage Class - # If defined, storageClassName: - # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning - # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. - storageClass: null + # -- Options to configure zone-aware replication for ingester + # Example configuration with full geographical redundancy: + # rollout_operator: + # enabled: true + # ingester: + # zoneAwareReplication: + # enabled: true + # topologyKey: 'kubernetes.io/hostname' # This generates default anti-affinity rules + # zones: # Zone list has to be fully redefined for modification. Update with you actual zones or skip to use logical zones only. + # - name: zone-a + # nodeSelector: + # topology.kubernetes.io/zone: us-central1-a + # storageClass: storage-class-us-central1-a + # - name: zone-a + # nodeSelector: + # topology.kubernetes.io/zone: us-central1-b + # storageClass: storage-class-us-central1-b + # - name: zone-c + # nodeSelector: + # topology.kubernetes.io/zone: us-central1-c + # storageClass: storage-class-us-central1-c + # + zoneAwareReplication: + # -- Enable zone-aware replication for ingester + enabled: true + # -- Zone definitions for ingester zones. Note: you have to redefine the whole list to change parts as YAML does not allow to modify parts of a list. + zones: + # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + - name: zone-a + # -- nodeselector to restrict where pods of this zone can be placed. E.g.: + # nodeSelector: + # topology.kubernetes.io/zone: zone-a + nodeSelector: null + # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) + extraAffinity: {} + # -- Ingester data Persistent Volume Storage Class + # If defined, storageClassName: + # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning + # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. + storageClass: null + # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + - name: zone-b + # -- nodeselector to restrict where pods of this zone can be placed. E.g.: + # nodeSelector: + # topology.kubernetes.io/zone: zone-b + nodeSelector: null + # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) + extraAffinity: {} + # -- Ingester data Persistent Volume Storage Class + # If defined, storageClassName: + # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning + # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. + storageClass: null + # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + - name: zone-c + # -- nodeselector to restrict where pods of this zone can be placed. E.g.: + # nodeSelector: + # topology.kubernetes.io/zone: zone-c + nodeSelector: null + # -- extraAffinity adds user defined custom affinity rules (merged with generated rules) + extraAffinity: {} + # -- Ingester data Persistent Volume Storage Class + # If defined, storageClassName: + # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning + # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. + storageClass: null # -- Adds the appProtocol field to the ingester service. This allows ingester to work with istio protocol selection. appProtocol: From 4b2b850fae6f703cb576366ace7ab5b9e43af94b Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:00:12 +0300 Subject: [PATCH 121/124] FIXED --- production/helm/loki/values.yaml | 35 ++++++++++++-------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 6bf018815b1bc..9284b3eecdc98 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1801,6 +1801,11 @@ ingester: # # storageClass: "-" + # -- Adds the appProtocol field to the ingester service. This allows ingester to work with istio protocol selection. + appProtocol: + # -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" + grpc: "" + # -- Options to configure zone-aware replication for ingester # Example configuration with full geographical redundancy: # rollout_operator: @@ -1824,8 +1829,15 @@ ingester: # storageClass: storage-class-us-central1-c # zoneAwareReplication: - # -- Enable zone-aware replication for ingester + # -- Enable zone awareness. enabled: true + # -- The percent of replicas in each zone that will be restarted at once. In a value of 0-100 + maxUnavailablePct: 33 + migration: + enabled: false + excludeDefaultZone: false + readPath: false + writePath: false # -- Zone definitions for ingester zones. Note: you have to redefine the whole list to change parts as YAML does not allow to modify parts of a list. zones: # -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -1868,27 +1880,6 @@ ingester: # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. storageClass: null - # -- Adds the appProtocol field to the ingester service. This allows ingester to work with istio protocol selection. - appProtocol: - # -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" - grpc: "" - # -- Enabling zone awareness on ingesters will create 3 statefulests where all writes will send a replica to each zone. - # This is primarily intended to accelerate rollout operations by allowing for multiple ingesters within a single - # zone to be shutdown and restart simultaneously (the remaining 2 zones will be guaranteed to have at least one copy - # of the data). - # Note: This can be used to run Loki over multiple cloud provider availability zones however this is not currently - # recommended as Loki is not optimized for this and cross zone network traffic costs can become extremely high - # extremely quickly. Even with zone awareness enabled, it is recommended to run Loki in a single availability zone. - zoneAwareReplication: - # -- Enable zone awareness. - enabled: true - # -- The percent of replicas in each zone that will be restarted at once. In a value of 0-100 - maxUnavailablePct: 33 - migration: - enabled: false - excludeDefaultZone: false - readPath: false - writePath: false # -- Configuration for the distributor distributor: # -- Number of replicas for the distributor From 48c16dfa44cf2deff29bc6bedd830b477d818c0d Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:24:29 +0300 Subject: [PATCH 122/124] fix bloom-builder --- .../loki/templates/bloom-builder/deployment-bloom-builder.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml b/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml index 5735de5da23d4..6a2be36e9420d 100644 --- a/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml +++ b/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml @@ -1,5 +1,6 @@ {{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} {{- if $isDistributed -}} +{{- if (gt (int .Values.bloomBuilder.replicas) 0) -}} apiVersion: apps/v1 kind: Deployment metadata: From 10adf202e77170766072dcdce597963d96cf5263 Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:25:37 +0300 Subject: [PATCH 123/124] fix bloom-builder --- .../loki/templates/bloom-builder/deployment-bloom-builder.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml b/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml index 6a2be36e9420d..b2daac22244af 100644 --- a/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml +++ b/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml @@ -141,3 +141,4 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- end -}} +{{- end -}} From 78013e5def3289a293718ac1abda8c7589b955eb Mon Sep 17 00:00:00 2001 From: michaelsudakov <86931587+michaelsudakov@users.noreply.github.com> Date: Sun, 6 Oct 2024 11:19:10 +0300 Subject: [PATCH 124/124] Update deployment-bloom-builder.yaml --- .../loki/templates/bloom-builder/deployment-bloom-builder.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml b/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml index b2daac22244af..cbed6b2fc8128 100644 --- a/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml +++ b/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml @@ -1,6 +1,4 @@ {{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} -{{- if $isDistributed -}} -{{- if (gt (int .Values.bloomBuilder.replicas) 0) -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -141,4 +139,3 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- end -}} -{{- end -}}