diff --git a/operations/helm/charts/mimir-distributed/CHANGELOG.md b/operations/helm/charts/mimir-distributed/CHANGELOG.md index e9b9ebe2511..1dd0f5a8b71 100644 --- a/operations/helm/charts/mimir-distributed/CHANGELOG.md +++ b/operations/helm/charts/mimir-distributed/CHANGELOG.md @@ -31,12 +31,12 @@ Entries should include a reference to the Pull Request that introduced the chang * [CHANGE] Reduce `-server.grpc-max-concurrent-streams` from 1000 to 500 for ingester and to 100 for all components. #5666 * [ENHANCEMENT] Update the `rollout-operator` subchart to `0.9.1`. #6022 #6110 * [BUGFIX] Let the unified gatway/nginx config listen on IPv6 as well. Followup to #5948. #6204 +* [FEATURE] Support monolithic deployment with the helm chart. #4832 ## 5.1.0 * [ENHANCEMENT] Update Mimir image to 2.10.0 and GEM image to v2.10.1. #6077 * [ENHANCEMENT] Make compactor podManagementPolicy configurable. #5902 -* [ENHANCEMENT] Distributor: dynamically set `GOMAXPROCS` based on the CPU request. This should reduce distributor CPU utilization, assuming the CPU request is set to a value close to the actual utilization. #5588 * [ENHANCEMENT] Querier: dynamically set `GOMAXPROCS` based on the CPU request. This should reduce noisy neighbour issues created by the querier, whose CPU utilization could eventually saturate the Kubernetes node if unbounded. #5646 * [ENHANCEMENT] Sets the `appProtocol` value to `tcp` for the `gossip-ring-svc` service template. This allows memberlist to work with istio protocol selection. #5673 * [ENHANCEMENT] Update the `rollout-operator` subchart to `0.8.0`. #5718 @@ -663,4 +663,4 @@ Entries should include a reference to the Pull Request that introduced the chang ## 0.1.0 -* [FEATURE] Initial commit, Mimir only, derived from `enterprise-metrics` chart. #1141 +* [FEATURE] Initial commit, Mimir only, derived from `enterprise-metrics` chart. #1141 \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/monolithic.yaml b/operations/helm/charts/mimir-distributed/monolithic.yaml new file mode 100644 index 00000000000..ff4ff58f231 --- /dev/null +++ b/operations/helm/charts/mimir-distributed/monolithic.yaml @@ -0,0 +1,81 @@ +# This is an example setup for monolithic mimir deployment + +deploymentMode: monolithic + +fullnameOverride: mimir + +serviceAccount: + annotations: + "eks.amazonaws.com/role-arn": "arn:aws:iam::829850591703:role/multi-az-eks-multi-az-mimir" + +mimir: + structuredConfig: + limits: + # Delete from storage metrics data older than 62 days. + compactor_blocks_retention_period: 62d + common: + storage: + backend: s3 + s3: + endpoint: s3.eu-west-1.amazonaws.com + region: eu-west-1 + blocks_storage: + storage_prefix: blocks + s3: + bucket_name: multi-az-eks-multi-az-mimir + alertmanager_storage: + storage_prefix: alertmanager + s3: + bucket_name: multi-az-eks-multi-az-mimir + ruler_storage: + storage_prefix: ruler + s3: + bucket_name: multi-az-eks-multi-az-mimir + +monolithic: + replicas: 3 + persistentVolume: + enabled: true + size: "8Gi" + storageClass: gp3-3000-125 + priorityClassName: "optional-rescheduling-priority-multi-az" + # The zone aware replication doesn't yet make a lot of difference, since it is not used at query side yet. This is + # however planned in an upcoming release, and therefore it's best to have this configuration already enabled. + zoneAwareReplication: + enabled: true + topologyKey: "topology.kubernetes.io/zone" # 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: eu-west-1a + - name: zone-b + nodeSelector: + topology.kubernetes.io/zone: eu-west-1b + - name: zone-c + nodeSelector: + topology.kubernetes.io/zone: eu-west-1c + compression: + enabled: true + +nginx: + replicas: 1 + priorityClassName: "mandatory-rescheduling-priority-multi-az" + ingress: + enabled: true + hosts: + - host: "mimir.multi-az.test.ngdata.com" + paths: + - path: / + pathType: Prefix + tls: + # empty, disabled. + +# Disable Minio, we use S3 storage instead +minio: + enabled: false + replicas: 0 + +# The Alert manager is currently not used. When enabling, it has to be configured for zone aware replication similar to +# monolithic setup. +alertmanager: + enabled: false \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl index cf2fa5f0640..e913494167e 100644 --- a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl +++ b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl @@ -397,6 +397,7 @@ Examples: */}} {{- define "mimir.componentSectionFromName" -}} {{- $componentsMap := dict + "monolithic" "monolithic" "admin-api" "admin_api" "admin-cache" "admin-cache" "alertmanager" "alertmanager" @@ -442,6 +443,7 @@ mimir.vaultAgent.annotations takes 2 arguments */}} {{- define "mimir.vaultAgent.annotations" -}} {{- $vaultEnabledComponents := dict + "monolithic" true "admin-api" true "alertmanager" true "compactor" true @@ -528,7 +530,7 @@ which allows us to keep generating everything for the default zone. {{- end -}} {{- $requestedReplicas := $componentSection.replicas -}} -{{- if and (has .component (list "ingester" "alertmanager")) $componentSection.zoneAwareReplication.migration.enabled (not $componentSection.zoneAwareReplication.migration.writePath) -}} +{{- if and (has .component (list "monolithic" "ingester" "alertmanager")) $componentSection.zoneAwareReplication.migration.enabled (not $componentSection.zoneAwareReplication.migration.writePath) -}} {{- $requestedReplicas = $componentSection.zoneAwareReplication.migration.replicas }} {{- end -}} {{- $replicaPerZone := div (add $requestedReplicas $numberOfZones -1) $numberOfZones -}} @@ -640,4 +642,4 @@ mimir.parseCPU takes 1 argument {{- else -}} {{- $value_string }} {{- end -}} -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-config.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-config.yaml index bae1b7c4273..c0387da8501 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-config.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-config.yaml @@ -1,3 +1,4 @@ +{{- if has .Values.deploymentMode (list "microservices" "monolithic")}} {{- if .Values.alertmanager.enabled -}} {{- if .Values.alertmanager.fallbackConfig -}} apiVersion: v1 @@ -14,3 +15,4 @@ data: {{- .Values.alertmanager.fallbackConfig | nindent 4 }} {{- end -}} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-dep.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-dep.yaml index fe5aaf80695..df3f48ad7bb 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-dep.yaml @@ -1,3 +1,4 @@ +{{- if has .Values.deploymentMode (list "microservices" "monolithic")}} {{- if .Values.alertmanager.enabled -}} {{- if not .Values.alertmanager.statefulSet.enabled -}} apiVersion: apps/v1 @@ -145,3 +146,4 @@ spec: {{- end }} {{- end -}} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-pdb.yaml index c0acf977ede..ea0aa5606ad 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-pdb.yaml @@ -1,3 +1,5 @@ +{{- if has .Values.deploymentMode (list "microservices" "monolithic")}} {{- if .Values.alertmanager.enabled -}} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "alertmanager" "memberlist" true) }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-servmon.yaml index 8e4521959ce..be3883cd77b 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-servmon.yaml @@ -1,3 +1,5 @@ +{{- if has .Values.deploymentMode (list "microservices" "monolithic")}} {{- if .Values.alertmanager.enabled -}} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "alertmanager" "memberlist" true) }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-statefulset.yaml index a8ac1e9ea82..a477ae1eb69 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-statefulset.yaml @@ -1,3 +1,4 @@ +{{- if has .Values.deploymentMode (list "microservices" "monolithic")}} {{- if .Values.alertmanager.enabled -}} {{- if .Values.alertmanager.statefulSet.enabled -}} {{- $args := dict "ctx" . "component" "alertmanager" "memberlist" true -}} @@ -197,3 +198,4 @@ spec: {{ end }} {{ end }} {{ end }} +{{ end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc-headless.yaml index f3ced60f4e6..0627623ba14 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc-headless.yaml @@ -1,3 +1,4 @@ +{{- if has .Values.deploymentMode (list "microservices" "monolithic")}} {{- if .Values.alertmanager.enabled -}} {{- $clusterPort := regexReplaceAll ".+[:]" (default "0.0.0.0:9094" (include "mimir.alertmanagerClusterBindAddress" .) ) "" -}} apiVersion: v1 @@ -32,3 +33,4 @@ spec: selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "alertmanager" "memberlist" true) | nindent 4 }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc.yaml index da6a7189992..7c818d9048f 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc.yaml @@ -1,3 +1,4 @@ +{{- if has .Values.deploymentMode (list "microservices" "monolithic")}} {{- if .Values.alertmanager.enabled -}} {{- $args := dict "ctx" . "component" "alertmanager" "memberlist" true -}} {{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} @@ -37,4 +38,5 @@ spec: --- {{ end }} {{ end }} +{{ end }} {{ end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-pdb.yaml index ede7b03f5cd..df2f5700400 100644 --- a/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-pdb.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if index .Values "chunks-cache" "enabled" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "chunks-cache") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-servmon.yaml index 1e28405954c..532fd2f4fc6 100644 --- a/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-servmon.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if index .Values "chunks-cache" "enabled" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "chunks-cache") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-statefulset.yaml index 3a836f7167e..7becd76eab2 100644 --- a/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-statefulset.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.memcached.statefulSet" (dict "ctx" $ "component" "chunks-cache" ) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-svc-headless.yaml index d2ece24830c..36fd43e250c 100644 --- a/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/chunks-cache/chunks-cache-svc-headless.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.memcached.service" (dict "ctx" $ "component" "chunks-cache" ) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-pdb.yaml index 095703bdd59..fcbaa906133 100644 --- a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-pdb.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "compactor" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-servmon.yaml index e60bf6b1026..fc16abbede4 100644 --- a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-servmon.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "compactor" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-statefulset.yaml index 472a32fe3db..9b4b55b5637 100644 --- a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-statefulset.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: apps/v1 kind: StatefulSet metadata: @@ -156,3 +157,4 @@ spec: {{- with .Values.compactor.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-svc.yaml b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-svc.yaml index a761a54740b..81051c98a33 100644 --- a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: v1 kind: Service metadata: @@ -23,3 +24,4 @@ spec: targetPort: grpc selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "compactor" "memberlist" true) | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml index 6ceb348a810..14545b37208 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: apps/v1 kind: Deployment metadata: @@ -139,4 +140,4 @@ spec: emptyDir: {} - name: active-queries emptyDir: {} - +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-pdb.yaml index f99c602c31d..cc32b684a37 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-pdb.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "distributor" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-servmon.yaml index d113fd9c06e..94dc1ff339a 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-servmon.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "distributor" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc-headless.yaml index d59b78c4824..f1d45c45a33 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc-headless.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: v1 kind: Service metadata: @@ -25,3 +26,4 @@ spec: targetPort: grpc selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "distributor" "memberlist" true) | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc.yaml index 868949de140..a55b4935f51 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: v1 kind: Service metadata: @@ -23,3 +24,4 @@ spec: targetPort: grpc selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "distributor" "memberlist" true) | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-dep.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-dep.yaml index 1fdd0dddf94..2aee2509353 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-dep.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if (eq (include "mimir.gateway.isEnabled" .) "true") }} {{- with .Values.gateway }} {{- $isGEMGateway := $.Values.enterprise.enabled -}} @@ -169,3 +170,4 @@ spec: {{- end }} {{- end -}} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-ingress.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-ingress.yaml index fd0a57de6bd..a38be49c090 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-ingress.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-ingress.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if and (eq (include "mimir.gateway.isEnabled" .) "true") .Values.gateway.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress @@ -42,3 +43,4 @@ spec: {{- end }} {{- end }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-pdb.yaml index 98ed873ef38..c161ff99e06 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-pdb.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if eq (include "mimir.gateway.isEnabled" .) "true" -}} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "gateway") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-route.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-route.yaml index c2a17f06dd7..021658d326e 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-route.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-route.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.gateway.route.enabled }} kind: Route apiVersion: route.openshift.io/v1 @@ -23,3 +24,4 @@ spec: {{- toYaml . | nindent 4 }} {{- end }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-servmon.yaml index 1902f737b64..b1b9983b321 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-servmon.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if and (eq (include "mimir.gateway.isEnabled" .) "true") (not .Values.gateway.enabledNonEnterprise) -}} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "gateway") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-svc.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-svc.yaml index 67853fb4f72..18f4156d017 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if eq (include "mimir.gateway.isEnabled" .) "true" -}} {{- with .Values.gateway -}} apiVersion: v1 @@ -35,3 +36,4 @@ spec: {{- include "mimir.selectorLabels" (dict "ctx" $ "component" "gateway") | nindent 4 }} {{- end -}} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2-hpa.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2-hpa.yaml index b6ae5265762..a2b99e5943e 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2-hpa.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2-hpa.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.gateway.autoscaling.enabled }} {{- if eq (include "mimir.hpa.version" .) "autoscaling/v2" }} apiVersion: autoscaling/v2 @@ -33,3 +34,4 @@ spec: {{- end }} {{- end -}} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2beta1-hpa.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2beta1-hpa.yaml index 90e08cc9016..bff5de5f79f 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2beta1-hpa.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2beta1-hpa.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.gateway.autoscaling.enabled }} {{- if eq (include "mimir.hpa.version" .) "autoscaling/v2beta1" }} apiVersion: autoscaling/v2beta1 @@ -29,3 +30,4 @@ spec: {{- end }} {{- end -}} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/nginx-configmap.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/nginx-configmap.yaml index 8a24a4efead..08ac60fcf2f 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/nginx-configmap.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/nginx-configmap.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if and (not .Values.enterprise.enabled) .Values.gateway.enabledNonEnterprise -}} apiVersion: v1 kind: ConfigMap @@ -10,3 +11,4 @@ data: nginx.conf: | {{- tpl .Values.gateway.nginx.config.file . | nindent 4 }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/nginx-secret.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/nginx-secret.yaml index 15402738a00..1696cc78e01 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/nginx-secret.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/nginx-secret.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if not .Values.enterprise.enabled -}} {{- if and .Values.gateway.enabledNonEnterprise .Values.gateway.nginx.basicAuth.enabled (not .Values.gateway.nginx.basicAuth.existingSecret) }} apiVersion: v1 @@ -12,3 +13,4 @@ stringData: {{- tpl .Values.gateway.nginx.basicAuth.htpasswd $ | nindent 4 }} {{- end -}} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/gossip-ring/gossip-ring-svc.yaml b/operations/helm/charts/mimir-distributed/templates/gossip-ring/gossip-ring-svc.yaml index 32da7fa2317..44dd8839f22 100644 --- a/operations/helm/charts/mimir-distributed/templates/gossip-ring/gossip-ring-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gossip-ring/gossip-ring-svc.yaml @@ -16,4 +16,4 @@ spec: targetPort: {{ include "mimir.memberlistBindPort" . }} publishNotReadyAddresses: true selector: - {{- include "mimir.gossipRingSelectorLabels" (dict "ctx" .) | nindent 4 }} + {{- include "mimir.gossipRingSelectorLabels" (dict "ctx" .) | nindent 4 }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-pdb.yaml index 0d0232d0ed0..cd728495502 100644 --- a/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-pdb.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if index .Values "index-cache" "enabled" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "index-cache") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-servmon.yaml index 3fc39b0fd7d..44c2033d808 100644 --- a/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-servmon.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if index .Values "index-cache" "enabled" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "index-cache") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-statefulset.yaml index 98362eea512..80fd4f6a84b 100644 --- a/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-statefulset.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.memcached.statefulSet" (dict "ctx" $ "component" "index-cache" ) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-svc-headless.yaml index b86b205bd9b..43d52c7fe77 100644 --- a/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/index-cache/index-cache-svc-headless.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.memcached.service" (dict "ctx" $ "component" "index-cache" ) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-pdb.yaml index 80b49b292e0..d9a68dfd0e8 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-pdb.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "ingester" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-servmon.yaml index cb49e6254b4..6db86b6d131 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-servmon.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "ingester" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-statefulset.yaml index 3723659a137..79eb510b288 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-statefulset.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} {{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} {{- range $zoneName, $rolloutZone := $zonesMap }} @@ -180,3 +181,4 @@ spec: --- {{ end }} {{ end }} +{{ end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc-headless.yaml index 0c5c430c6a1..449076b67d0 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc-headless.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: v1 kind: Service metadata: @@ -25,3 +26,4 @@ spec: targetPort: grpc selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "ingester" "memberlist" true) | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc.yaml b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc.yaml index 21afa4d7f48..3e55b8ebba9 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- $args := dict "ctx" . "component" "ingester" "memberlist" true -}} {{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} {{- range $zoneName, $rolloutZone := $zonesMap }} @@ -35,4 +36,5 @@ spec: --- {{ end }} +{{ end }} {{ end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-pdb.yaml index dc03f8ebfc2..95473108bca 100644 --- a/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-pdb.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if index .Values "metadata-cache" "enabled" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "metadata-cache" ) }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-servmon.yaml index c6d9139db25..45951c3d075 100644 --- a/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-servmon.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if index .Values "metadata-cache" "enabled" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "metadata-cache") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-statefulset.yaml index 5a73fe4f42c..d3fd26e8aa1 100644 --- a/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-statefulset.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.memcached.statefulSet" (dict "ctx" $ "component" "metadata-cache" ) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-svc-headless.yaml index 5cc5ad6b106..5314389c676 100644 --- a/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metadata-cache/metadata-cache-svc-headless.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.memcached.service" (dict "ctx" $ "component" "metadata-cache" ) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-pdb.yaml new file mode 100644 index 00000000000..3094cc43d4c --- /dev/null +++ b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-pdb.yaml @@ -0,0 +1,3 @@ +{{- if eq .Values.deploymentMode "monolithic" }} +{{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "monolithic" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-servmon.yaml new file mode 100644 index 00000000000..a36c71b111a --- /dev/null +++ b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-servmon.yaml @@ -0,0 +1,3 @@ +{{- if eq .Values.deploymentMode "monolithic" }} +{{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "monolithic" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-statefulset.yaml new file mode 100644 index 00000000000..f852d3a88d0 --- /dev/null +++ b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-statefulset.yaml @@ -0,0 +1,194 @@ +{{- if eq .Values.deploymentMode "monolithic" }} +{{- $args := dict "ctx" . "component" "monolithic" "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 "mimir.resourceName" $args }} + labels: + {{- include "mimir.labels" $args | nindent 4 }} + annotations: + {{- include "mimir.componentAnnotations" $args | nindent 4 }} + namespace: {{ .Release.Namespace | quote }} +spec: + podManagementPolicy: {{ .Values.monolithic.podManagementPolicy }} + replicas: {{ $rolloutZone.replicas }} + selector: + matchLabels: + {{- include "mimir.selectorLabels" $args | nindent 6 }} + updateStrategy: + {{- if $zoneName }} + type: OnDelete + {{- else }} + {{- toYaml .Values.monolithic.statefulStrategy | nindent 4 }} + {{- end }} + serviceName: {{ template "mimir.fullname" . }}-monolithic{{- if not .Values.enterprise.legacyLabels -}}-headless{{- end -}} + {{- if .Values.monolithic.persistentVolume.enabled }} + volumeClaimTemplates: + - metadata: + name: storage + {{- if .Values.monolithic.persistentVolume.annotations }} + annotations: + {{- toYaml .Values.monolithic.persistentVolume.annotations | nindent 10 }} + {{- end }} + spec: + {{- if .Values.monolithic.persistentVolume.storageClass }} + {{- if (eq "-" .Values.monolithic.persistentVolume.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.monolithic.persistentVolume.storageClass }}" + {{- end }} + {{- end }} + accessModes: + {{- toYaml .Values.monolithic.persistentVolume.accessModes | nindent 10 }} + resources: + requests: + storage: "{{ .Values.monolithic.persistentVolume.size }}" + {{- end }} + template: + metadata: + labels: + {{- include "mimir.podLabels" $args | nindent 8 }} + annotations: + {{- include "mimir.podAnnotations" $args | nindent 8 }} + namespace: {{ .Release.Namespace | quote }} + spec: + {{- with .Values.monolithic.schedulerName }} + schedulerName: {{ . | quote }} + {{- end }} + serviceAccountName: {{ template "mimir.serviceAccountName" . }} + {{- if .Values.monolithic.priorityClassName }} + priorityClassName: {{ .Values.monolithic.priorityClassName }} + {{- end }} + securityContext: + {{- include "mimir.lib.podSecurityContext" $args | nindent 8 }} + initContainers: + {{- toYaml .Values.monolithic.initContainers | nindent 8 }} + {{- if .Values.image.pullSecrets }} + imagePullSecrets: + {{- range .Values.image.pullSecrets }} + - name: {{ . }} + {{- end }} + {{- end }} + nodeSelector: + {{- $rolloutZone.nodeSelector | toYaml | nindent 8 }} + affinity: + {{- $rolloutZone.affinity | toYaml | nindent 8 }} + {{- include "mimir.lib.topologySpreadConstraints" (dict "ctx" . "component" "monolithic") | nindent 6 }} + tolerations: + {{- toYaml .Values.monolithic.tolerations | nindent 8 }} + terminationGracePeriodSeconds: {{ .Values.monolithic.terminationGracePeriodSeconds }} + volumes: + - name: config + {{- include "mimir.configVolume" . | nindent 10 }} + {{- if .Values.enterprise.enabled }} + - name: license + secret: + secretName: {{ tpl .Values.license.secretName . }} + {{- end }} + - name: runtime-config + configMap: + name: {{ template "mimir.fullname" . }}-runtime + {{- if not .Values.monolithic.persistentVolume.enabled }} + - name: storage + emptyDir: {} + {{- end }} + {{- if .Values.monolithic.extraVolumes }} + {{ toYaml .Values.monolithic.extraVolumes | nindent 8 }} + {{- end }} + - name: active-queries + emptyDir: {} + containers: + {{- if .Values.monolithic.extraContainers }} + {{ toYaml .Values.monolithic.extraContainers | nindent 8 }} + {{- end }} + - name: monolithic + image: "{{ include "mimir.imageReference" . }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - "-target=all" + - "-config.expand-env=true" + - "-config.file=/etc/mimir/mimir.yaml" + {{- if $zoneName }} + - "-ingester.ring.instance-availability-zone={{ $zoneName }}" + - "-store-gateway.sharding-ring.instance-availability-zone={{ $zoneName }}" + {{- else }} + - "-ingester.ring.instance-availability-zone=zone-default" + {{- if .Values.monolithic.zoneAwareReplication.migration.enabled }} + - "-blocks-storage.tsdb.flush-blocks-on-shutdown=true" + - "-ingester.ring.unregister-on-shutdown=true" + - "-store-gateway.sharding-ring.prefix=collectors/" + - "-store-gateway.sharding-ring.zone-awareness-enabled=false" + {{- end }} + {{- end }} + - "-server.grpc.keepalive.max-connection-age=2562047h" # 100000 days, effectively infinity + - "-server.grpc.keepalive.max-connection-age-grace=2562047h" # 100000 days, effectively infinity + {{- if .Values.monolithic.compression.enabled }} + - "-query-frontend.grpc-client-config.grpc-compression={{ .Values.monolithic.compression.algorithm }}" + - "-query-scheduler.grpc-client-config.grpc-compression={{ .Values.monolithic.compression.algorithm }}" + - "-ruler.client.grpc-compression={{ .Values.monolithic.compression.algorithm }}" + - "-ruler.query-frontend.grpc-client-config.grpc-compression={{ .Values.monolithic.compression.algorithm }}" + - "-ingester.client.grpc-compression={{ .Values.monolithic.compression.algorithm }}" + {{- end }} + {{- range $key, $value := .Values.monolithic.extraArgs }} + - "-{{ $key }}={{ $value }}" + {{- end }} + volumeMounts: + {{- if .Values.monolithic.extraVolumeMounts }} + {{ toYaml .Values.monolithic.extraVolumeMounts | nindent 12}} + {{- end }} + - name: config + mountPath: /etc/mimir + - name: runtime-config + mountPath: /var/{{ include "mimir.name" . }} + - name: storage + mountPath: "/data" + {{- if .Values.monolithic.persistentVolume.subPath }} + subPath: {{ .Values.monolithic.persistentVolume.subPath }} + {{- else }} + {{- end }} + {{- if .Values.enterprise.enabled }} + - name: license + mountPath: /license + {{- end }} + - name: active-queries + mountPath: /active-query-tracker + ports: + - name: http-metrics + containerPort: {{ include "mimir.serverHttpListenPort" . }} + protocol: TCP + - name: grpc + containerPort: {{ include "mimir.serverGrpcListenPort" . }} + protocol: TCP + - name: memberlist + containerPort: {{ include "mimir.memberlistBindPort" . }} + protocol: TCP + livenessProbe: + {{- toYaml .Values.monolithic.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.monolithic.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.monolithic.resources | nindent 12 }} + securityContext: + {{- toYaml .Values.monolithic.containerSecurityContext | nindent 12 }} + env: + {{- with .Values.global.extraEnv }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.monolithic.env }} + {{- toYaml . | nindent 12 }} + {{- end }} + envFrom: + {{- with .Values.global.extraEnvFrom }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.monolithic.extraEnvFrom }} + {{- toYaml . | nindent 12 }} + {{- end }} +--- +{{ end }} +{{ end }} +{{ end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-svc-headless.yaml new file mode 100644 index 00000000000..3520dbd8f89 --- /dev/null +++ b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-svc-headless.yaml @@ -0,0 +1,30 @@ +{{- if eq .Values.deploymentMode "monolithic" }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mimir.resourceName" (dict "ctx" . "component" "monolithic") }}-headless + labels: + {{- include "mimir.labels" (dict "ctx" . "component" "monolithic" "memberlist" true) | nindent 4 }} + prometheus.io/service-monitor: "false" + {{- with .Values.monolithic.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- toYaml .Values.monolithic.service.annotations | nindent 4 }} + namespace: {{ .Release.Namespace | quote }} +spec: + type: ClusterIP + clusterIP: None + ports: + - port: {{ include "mimir.serverHttpListenPort" .}} + protocol: TCP + name: http-metrics + targetPort: http-metrics + - port: {{ include "mimir.serverGrpcListenPort" . }} + protocol: TCP + name: grpc + targetPort: grpc + selector: + {{- include "mimir.selectorLabels" (dict "ctx" . "component" "monolithic" "memberlist" true) | nindent 4 }} + publishNotReadyAddresses: true +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-svc.yaml b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-svc.yaml new file mode 100644 index 00000000000..82ca4ed3d5b --- /dev/null +++ b/operations/helm/charts/mimir-distributed/templates/monolithic/monolithic-svc.yaml @@ -0,0 +1,40 @@ +{{- if eq .Values.deploymentMode "monolithic" }} +{{- $args := dict "ctx" . "component" "monolithic" "memberlist" true -}} +{{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} +{{- range $zoneName, $rolloutZone := $zonesMap }} +{{- with $ -}} +{{- $_ := set $args "rolloutZoneName" $zoneName -}} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mimir.resourceName" $args }} + labels: + {{- include "mimir.labels" $args | nindent 4 }} + {{- if and $zoneName .Values.monolithic.zoneAwareReplication.migration.enabled }} + # Prevent scraping PODs via this service during migration as the original non zone-aware service already scrapes all PODs and you get duplicate metrics. + prometheus.io/service-monitor: "false" + {{- end }} + {{- with .Values.monolithic.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- toYaml .Values.monolithic.service.annotations | nindent 4 }} + namespace: {{ .Release.Namespace | quote }} +spec: + type: ClusterIP + ports: + - port: {{ include "mimir.serverHttpListenPort" .}} + protocol: TCP + name: http-metrics + targetPort: http-metrics + - port: {{ include "mimir.serverGrpcListenPort" . }} + protocol: TCP + name: grpc + targetPort: grpc + selector: + {{- include "mimir.selectorLabels" $args | nindent 4 }} + +--- +{{ end }} +{{ end }} +{{ end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-dep.yaml b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-dep.yaml index 1406e867300..e3a282b693b 100644 --- a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-dep.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.overrides_exporter.enabled -}} apiVersion: apps/v1 kind: Deployment @@ -124,3 +125,4 @@ spec: - name: active-queries emptyDir: {} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-pdb.yaml index ab307285c8a..f26f0014ca6 100644 --- a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-pdb.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.overrides_exporter.enabled -}} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "overrides-exporter") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-servmon.yaml index 809d0e75efa..639ede44ecd 100644 --- a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-servmon.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.overrides_exporter.enabled -}} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "overrides-exporter") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-svc.yaml b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-svc.yaml index 5e42a7f3f64..de6bd216f68 100644 --- a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.overrides_exporter.enabled -}} apiVersion: v1 kind: Service @@ -25,3 +26,4 @@ spec: selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "overrides-exporter") | nindent 4 }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/querier/querier-dep.yaml b/operations/helm/charts/mimir-distributed/templates/querier/querier-dep.yaml index 0e46211e1cb..55ed03083f0 100644 --- a/operations/helm/charts/mimir-distributed/templates/querier/querier-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/querier/querier-dep.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: apps/v1 kind: Deployment metadata: @@ -142,3 +143,4 @@ spec: emptyDir: {} - name: active-queries emptyDir: {} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/querier/querier-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/querier/querier-pdb.yaml index 07ed28d0c3e..edb587a687b 100644 --- a/operations/helm/charts/mimir-distributed/templates/querier/querier-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/querier/querier-pdb.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "querier" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/querier/querier-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/querier/querier-servmon.yaml index 516603c762e..219520beed1 100644 --- a/operations/helm/charts/mimir-distributed/templates/querier/querier-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/querier/querier-servmon.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "querier" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/querier/querier-svc.yaml b/operations/helm/charts/mimir-distributed/templates/querier/querier-svc.yaml index 1eb323ec5a7..0c3bbd73592 100644 --- a/operations/helm/charts/mimir-distributed/templates/querier/querier-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/querier/querier-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: v1 kind: Service metadata: @@ -23,3 +24,4 @@ spec: targetPort: grpc selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "querier" "memberlist" true) | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-dep.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-dep.yaml index 52f30495c4a..e991d3961aa 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-dep.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: apps/v1 kind: Deployment metadata: @@ -124,3 +125,4 @@ spec: emptyDir: {} - name: active-queries emptyDir: {} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-pdb.yaml index e6cb8e1399d..0f86510fff3 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-pdb.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "query-frontend") }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-servmon.yaml index 0b2585fcfc1..3523d2f9152 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-servmon.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "query-frontend") }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc-headless.yaml index b30e7f86630..d9d7e73f2e4 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc-headless.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if not .Values.query_scheduler.enabled }} apiVersion: v1 kind: Service @@ -28,3 +29,4 @@ spec: selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "query-frontend") | nindent 4 }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc.yaml index 3eec5d64204..4c7c76d67a7 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: v1 kind: Service metadata: @@ -23,3 +24,4 @@ spec: targetPort: grpc selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "query-frontend") | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-dep.yaml b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-dep.yaml index 7db67c0acf8..f799abf72b2 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-dep.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.query_scheduler.enabled }} apiVersion: apps/v1 kind: Deployment @@ -127,3 +128,4 @@ spec: - name: active-queries emptyDir: {} {{- end }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-pdb.yaml index f38e16f2a9a..7a5f6b11ec6 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-pdb.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.query_scheduler.podDisruptionBudget -}} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "query-scheduler") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-servmon.yaml index f20a68ab2ea..540c864a555 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-servmon.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.query_scheduler.enabled }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "query-scheduler") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc-headless.yaml index c02dba718bf..49940771672 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc-headless.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.query_scheduler.enabled }} apiVersion: v1 kind: Service @@ -28,3 +29,4 @@ spec: selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "query-scheduler") | nindent 4 }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc.yaml b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc.yaml index abef45e5724..e8654e22979 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.query_scheduler.enabled }} apiVersion: v1 kind: Service @@ -25,3 +26,4 @@ spec: selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "query-scheduler") | nindent 4 }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-pdb.yaml index 097cff9e0db..bcddd720c4c 100644 --- a/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-pdb.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if index .Values "results-cache" "enabled" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "results-cache") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-servmon.yaml index 6b143927a9a..66b7e901223 100644 --- a/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-servmon.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if index .Values "results-cache" "enabled" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "results-cache") }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-statefulset.yaml index 8689c85b34b..e4609ac1867 100644 --- a/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-statefulset.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.memcached.statefulSet" (dict "ctx" $ "component" "results-cache" ) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-svc-headless.yaml index 1cdec3328fe..c650cf7d9bf 100644 --- a/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/results-cache/results-cache-svc-headless.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.memcached.service" (dict "ctx" $ "component" "results-cache" ) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-dep.yaml b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-dep.yaml index 652dded3b5f..ffcaa43324c 100644 --- a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-dep.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.ruler.enabled -}} apiVersion: apps/v1 kind: Deployment @@ -141,3 +142,4 @@ spec: - name: active-queries emptyDir: {} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-pdb.yaml index 4693d4571c8..f753e748cb3 100644 --- a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-pdb.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.ruler.enabled -}} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "ruler" "memberlist" true) }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-servmon.yaml index 67d2142c184..428ab0b5983 100644 --- a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-servmon.yaml @@ -1,3 +1,5 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.ruler.enabled -}} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "ruler" "memberlist" true) }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-svc.yaml b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-svc.yaml index 477f6266590..b1ccce6d1db 100644 --- a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.ruler.enabled -}} apiVersion: v1 kind: Service @@ -21,3 +22,4 @@ spec: selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "ruler" "memberlist" true) | nindent 4 }} {{- end -}} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-pdb.yaml b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-pdb.yaml index 29ab26f31ec..2153b9799d5 100644 --- a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-pdb.yaml +++ b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-pdb.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "store-gateway" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-servmon.yaml index 39da8412c5d..dca6539e247 100644 --- a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-servmon.yaml @@ -1 +1,3 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "store-gateway" "memberlist" true) }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-statefulset.yaml index f163bf6f39e..f0ed34be410 100644 --- a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-statefulset.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- $args := dict "ctx" $ "component" "store-gateway" "memberlist" true -}} {{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} {{- range $zoneName, $rolloutZone := $zonesMap }} @@ -189,4 +190,5 @@ spec: --- {{ end }} +{{ end }} {{ end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc-headless.yaml index 2fb878ecaac..42856794d62 100644 --- a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc-headless.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} apiVersion: v1 kind: Service metadata: @@ -25,3 +26,4 @@ spec: targetPort: grpc selector: {{- include "mimir.selectorLabels" (dict "ctx" . "component" "store-gateway" "memberlist" true) | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc.yaml b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc.yaml index d637a070c70..05671b5d142 100644 --- a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc.yaml @@ -1,3 +1,4 @@ +{{- if eq .Values.deploymentMode "microservices" }} {{- $args := dict "ctx" $ "component" "store-gateway" "memberlist" true -}} {{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}} {{- range $zoneName, $rolloutZone := $zonesMap }} @@ -35,4 +36,5 @@ spec: --- {{ end }} +{{ end }} {{ end }} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/templates/validate.yaml b/operations/helm/charts/mimir-distributed/templates/validate.yaml index ca1bc75b65f..1d7ca57e935 100644 --- a/operations/helm/charts/mimir-distributed/templates/validate.yaml +++ b/operations/helm/charts/mimir-distributed/templates/validate.yaml @@ -149,7 +149,13 @@ {{- end -}} -{{- if and .Values.ingester.zoneAwareReplication.enabled (not ((($calculatedConfig).ingester).ring).zone_awareness_enabled) -}} +{{- if + and + (or + (and (eq .Values.deploymentMode "microservices") .Values.ingester.zoneAwareReplication.enabled) + (and (eq .Values.deploymentMode "monolithic") .Values.monolithic.zoneAwareReplication.enabled)) + (not ((($calculatedConfig).ingester).ring).zone_awareness_enabled) +}} {{- fail "You have set ingester.zoneAwareReplication.enabled=true. The mimir.config must include ingester.ring.zone_awareness_enabled=true. Please merge the latest mimir.config from the chart with your mimir.config."}} {{- end -}} @@ -174,8 +180,13 @@ {{- end -}} {{- end -}} - -{{- if and .Values.store_gateway.zoneAwareReplication.enabled (not ((($calculatedConfig).store_gateway).sharding_ring).zone_awareness_enabled) -}} +{{- if + and + (or + (and (eq .Values.deploymentMode "microservices") .Values.store_gateway.zoneAwareReplication.enabled) + (and (eq .Values.deploymentMode "monolithic") .Values.monolithic.zoneAwareReplication.enabled)) + (not ((($calculatedConfig).store_gateway).sharding_ring).zone_awareness_enabled) +}} {{- fail "You have set store_gateway.zoneAwareReplication.enabled=true. The mimir.config must include store_gateway.sharding_ring.zone_awareness_enabled=true. Please merge the latest mimir.config from the chart with your mimir.config."}} {{- end -}} @@ -201,15 +212,15 @@ {{- end -}} {{- end -}} -{{- if and .Values.alertmanager.zoneAwareReplication.enabled (not .Values.alertmanager.statefulSet.enabled) -}} +{{- if and .Values.alertmanager.enabled .Values.alertmanager.zoneAwareReplication.enabled (not .Values.alertmanager.statefulSet.enabled) -}} {{- fail "You have set alertmanager.zoneAwareReplication.enabled=true, but alertmanager.statefulSet.enabled=false. This is not a supported configuration." -}} {{- end -}} -{{- if and .Values.alertmanager.zoneAwareReplication.enabled (not ((($calculatedConfig).alertmanager).sharding_ring).zone_awareness_enabled) -}} +{{- if and .Values.alertmanager.enabled .Values.alertmanager.zoneAwareReplication.enabled (not ((($calculatedConfig).alertmanager).sharding_ring).zone_awareness_enabled) -}} {{- fail "You have set alertmanager.zoneAwareReplication.enabled=true. The mimir.config must include alertmanager.sharding_ring.zone_awareness_enabled=true. Please merge the latest mimir.config from the chart with your mimir.config."}} {{- end -}} -{{- if and .Values.alertmanager.zoneAwareReplication.migration.enabled (not .Values.alertmanager.zoneAwareReplication.enabled) -}} +{{- if and .Values.alertmanager.enabled .Values.alertmanager.zoneAwareReplication.migration.enabled (not .Values.alertmanager.zoneAwareReplication.enabled) -}} {{- fail "You have set alertmanager.zoneAwareReplication.migration.enabled=true, but alertmanager.zoneAwareReplication.enabled=false. Please consult the Migrating from single zone with Helm document."}} {{- end -}} @@ -259,4 +270,4 @@ {{- fail "You have selected rbac.type=scc, you must set the values fsGroup, runAsGroup, runAsUser to null in rollout_operator.podSecurityContext" -}} {{- end -}} {{- end -}} -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/operations/helm/charts/mimir-distributed/values.yaml b/operations/helm/charts/mimir-distributed/values.yaml index a26f520a968..e5b0c598e29 100644 --- a/operations/helm/charts/mimir-distributed/values.yaml +++ b/operations/helm/charts/mimir-distributed/values.yaml @@ -30,6 +30,8 @@ nameOverride: null # Note: Grafana provided dashboards rely on the default naming and will need changes. fullnameOverride: null +deploymentMode: microservices + image: # -- Grafana Mimir container image repository. Note: for Grafana Enterprise Metrics use the value 'enterprise.image.repository' repository: grafana/mimir @@ -116,7 +118,7 @@ mimir: activity_tracker: filepath: /active-query-tracker/activity.log - + {{- if .Values.enterprise.enabled }} admin_api: leader_election: @@ -146,7 +148,7 @@ mimir: {{- end }} alertmanager: - data_dir: /data + data_dir: "/data/alertmanager" enable_api: true external_url: /alertmanager {{- if .Values.alertmanager.zoneAwareReplication.enabled }} @@ -227,7 +229,7 @@ mimir: max_opening_blocks_concurrency: 4 symbols_flushers_concurrency: 4 first_level_compaction_wait_period: 25m - data_dir: "/data" + data_dir: "/data/compactor" sharding_ring: wait_stability_min_duration: 1m @@ -243,19 +245,26 @@ mimir: cache_results: true query_sharding_target_series_per_shard: 2500 {{- end }} + {{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.query_scheduler.enabled }} scheduler_address: {{ template "mimir.fullname" . }}-query-scheduler-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverGrpcListenPort" . }} {{- end }} + {{- end }} frontend_worker: grpc_client_config: max_send_msg_size: 419430400 # 400MiB + {{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.query_scheduler.enabled }} scheduler_address: {{ template "mimir.fullname" . }}-query-scheduler-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverGrpcListenPort" . }} {{- else }} frontend_address: {{ template "mimir.fullname" . }}-query-frontend-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverGrpcListenPort" . }} {{- end }} + {{- else if eq .Values.deploymentMode "monolithic" }} + frontend_address: {{ include "mimir.resourceName" (dict "ctx" . "component" "monolithic") }}-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverGrpcListenPort" . }} + {{- end }} + {{- if eq .Values.deploymentMode "microservices" }} {{- if and .Values.enterprise.enabled }} gateway: proxy: @@ -284,14 +293,18 @@ mimir: url: http://{{ template "mimir.fullname" . }}-graphite-querier.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} {{- end}} {{- end }} + {{- end }} ingester: ring: final_sleep: 0s num_tokens: 512 - tokens_file_path: /data/tokens + tokens_file_path: /data/ingester/tokens unregister_on_shutdown: false - {{- if .Values.ingester.zoneAwareReplication.enabled }} + {{- if or + (and (eq .Values.deploymentMode "microservices") .Values.ingester.zoneAwareReplication.enabled) + (and (eq .Values.deploymentMode "monolithic") .Values.monolithic.zoneAwareReplication.enabled) + }} zone_awareness_enabled: true {{- end }} @@ -300,6 +313,7 @@ mimir: max_recv_msg_size: 104857600 max_send_msg_size: 104857600 + {{- if eq .Values.deploymentMode "microservices" }} {{- if .Values.enterprise.enabled }} instrumentation: enabled: true @@ -309,6 +323,7 @@ mimir: license: path: "/license/license.jwt" {{- end }} + {{- end }} limits: # Limit queries to 500 days. You can override this on a per-tenant basis. @@ -337,9 +352,13 @@ mimir: max_outstanding_requests_per_tenant: 800 ruler: + {{- if eq .Values.deploymentMode "microservices" }} alertmanager_url: dnssrvnoa+http://_http-metrics._tcp.{{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}/alertmanager + {{- else if eq .Values.deploymentMode "monolithic" }} + alertmanager_url: dnssrvnoa+http://_http-metrics._tcp.{{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}/alertmanager + {{- end }} enable_api: true - rule_path: /data + rule_path: "/data/ruler" {{- if or (.Values.minio.enabled) (index .Values "metadata-cache" "enabled") }} ruler_storage: @@ -372,16 +391,23 @@ mimir: store_gateway: sharding_ring: wait_stability_min_duration: 1m - {{- if .Values.store_gateway.zoneAwareReplication.enabled }} + {{- if or + (and (eq .Values.deploymentMode "microservices") .Values.store_gateway.zoneAwareReplication.enabled) + (and (eq .Values.deploymentMode "monolithic") .Values.monolithic.zoneAwareReplication.enabled) + }} kvstore: prefix: multi-zone/ {{- end }} tokens_file_path: /data/tokens unregister_on_shutdown: false - {{- if .Values.store_gateway.zoneAwareReplication.enabled }} + {{- if or + (and (eq .Values.deploymentMode "microservices") .Values.store_gateway.zoneAwareReplication.enabled) + (and (eq .Values.deploymentMode "monolithic") .Values.monolithic.zoneAwareReplication.enabled) + }} zone_awareness_enabled: true {{- end }} + {{- if eq .Values.deploymentMode "microservices" }} {{- if and .Values.enterprise.enabled .Values.graphite.enabled }} graphite: enabled: true @@ -406,7 +432,8 @@ mimir: memcached: addresses: dnssrvnoa+{{ template "mimir.fullname" . }}-gr-metricname-cache.{{ .Release.Namespace}}.svc:11211 timeout: 1s - {{- end}} + {{- end }} + {{- end }} # -- Additional structured values on top of the text based 'mimir.config'. Applied after the text based config is evaluated for templates. Enables adding and modifying YAML elements in the evaulated 'mimir.config'. structuredConfig: {} @@ -2379,66 +2406,117 @@ nginx: # Distributor endpoints location /distributor { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $distributor {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /api/v1/push { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $distributor {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location /otlp/v1/metrics { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $distributor {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Alertmanager endpoints location {{ template "mimir.alertmanagerHttpPrefix" . }} { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $alertmanager {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /multitenant_alertmanager/status { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $alertmanager {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /api/v1/alerts { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $alertmanager {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Ruler endpoints location {{ template "mimir.prometheusHttpPrefix" . }}/config/v1/rules { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $ruler {{ template "mimir.fullname" . }}-monolithic.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location {{ template "mimir.prometheusHttpPrefix" . }}/api/v1/rules { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $ruler {{ template "mimir.fullname" . }}-monolithic.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location {{ template "mimir.prometheusHttpPrefix" . }}/api/v1/alerts { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $ruler {{ template "mimir.fullname" . }}-monolithic.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /ruler/ring { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $ruler {{ template "mimir.fullname" . }}-monolithic.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Rest of {{ template "mimir.prometheusHttpPrefix" . }} goes to the query frontend location {{ template "mimir.prometheusHttpPrefix" . }} { - set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $query_frontend {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$query_frontend:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Buildinfo endpoint can go to any component location = /api/v1/status/buildinfo { - set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; - proxy_pass http://$query_frontend:{{ include "mimir.serverHttpListenPort" . }}$request_uri; + {{- if eq .Values.deploymentMode "microservices" }} + set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $query_frontend {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$query_frontend:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Compactor endpoint for uploading blocks location /api/v1/upload/block/ { - set $compactor {{ template "mimir.fullname" . }}-compactor.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- if eq .Values.deploymentMode "microservices" }} + set $compactor {{ template "mimir.fullname" . }}-compactor.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- else if eq .Values.deploymentMode "monolithic" }} + set $compactor {{ template "mimir.fullname" . }}-monolithic-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + {{- end }} proxy_pass http://$compactor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } @@ -3638,6 +3716,196 @@ continuous_test: tolerations: [] terminationGracePeriodSeconds: 30 +monolithic: + # -- Total number of replicas for the monolithic across all availability zones + # If ingester.zoneAwareReplication.enabled=false, this number is taken as is. + # Otherwise each zone starts `ceil(replicas / number_of_zones)` number of pods. + # E.g. if 'replicas' is set to 4 and there are 3 zones, then 4/3=1.33 and after rounding up it means 2 pods per zone are started. + replicas: 3 + # TODO Currently I have only foreseen to enable compression for the monolithic deployment mode + compression: + enabled: false + algorithm: snappy + statefulSet: + enabled: true + + service: + annotations: {} + labels: {} + + # -- Optionally set the scheduler for pods of the monolithic deployment + schedulerName: "" + + resources: + requests: + cpu: 100m + memory: 512Mi + + # Additional monolithic container arguments, e.g. log level (debug, info, warn, error) + extraArgs: {} + # Pod Labels + podLabels: {} + + # Pod Annotations + podAnnotations: {} + + # -- The name of the PriorityClass for monolithic pods + priorityClassName: null + + # -- Pod Disruption Budget for monolithic, this will be applied across availability zones to prevent losing redundancy + podDisruptionBudget: + maxUnavailable: 1 + + podManagementPolicy: Parallel + + # -- NodeSelector to pin monolithic pods to certain set of nodes. This is ignored when monolithic.zoneAwareReplication.enabled=true. + nodeSelector: {} + # -- Pod affinity settings for the monolithic. This is ignored when monolithic.zoneAwareReplication.enabled=true. + affinity: {} + + # -- topologySpreadConstraints allows to customize the default topologySpreadConstraints. This can be either a single dict as shown below or a slice of topologySpreadConstraints. + # labelSelector is taken from the constraint itself (if it exists) or is generated by the chart using the same selectors as for services. + # It is recommended to replace this with requiredDuringSchedulingIgnoredDuringExecution podAntiAffinity rules when + # deploying to production. + topologySpreadConstraints: + maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: ScheduleAnyway + + annotations: {} + + persistentVolume: + # If true and monolithic.statefulSet.enabled is true, + # Monolithic will create/use a Persistent Volume Claim + # If false, use emptyDir + # + enabled: true + + # Ingester data Persistent Volume Claim annotations + # + annotations: {} + + # Monolithic 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 + + # Monolithic data Persistent Volume size + size: 2Gi + + # Subdirectory of Monolithic data Persistent Volume to mount + # Useful if the volume's root directory is not empty + subPath: '' + + + # Monolithic 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. + # + # storageClass: "-" + + readinessProbe: + httpGet: + path: /ready + port: http-metrics + initialDelaySeconds: 60 + + # -- SecurityContext override for monolithic pods + securityContext: {} + + # -- The SecurityContext for monolithic containers + containerSecurityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: [ALL] + + # -- updateStrategy of the monolithic statefulset. This is ignored when monolithic.zoneAwareReplication.enabled=true. + statefulStrategy: + type: RollingUpdate + + terminationGracePeriodSeconds: 240 + + tolerations: [] + initContainers: [] + extraContainers: [] + extraVolumes: [] + extraVolumeMounts: [] + env: [] + extraEnvFrom: [] + + # -- Options to configure zone-aware replication for monolithic + # Example configuration with full geographical redundancy: + # rollout_operator: + # enabled: true + # monolithic: + # 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 + # - name: zone-a + # nodeSelector: + # topology.kubernetes.io/zone: us-central1-b + # - name: zone-c + # nodeSelector: + # topology.kubernetes.io/zone: us-central1-c + # + zoneAwareReplication: + # -- Enable zone-aware replication for ingester + enabled: true + # -- Maximum number of ingesters that can be unavailable per zone during rollout + maxUnavailable: 25 + # -- topologyKey to use in pod anti-affinity. If unset, no anti-affinity rules are generated. If set, the generated anti-affinity rule makes sure that pods from different zones do not mix. + # E.g.: topologyKey: 'kubernetes.io/hostname' + topologyKey: null + # -- Auxiliary values for migration, see https://grafana.com/docs/mimir/latest/migration-guide/migrating-from-single-zone-with-helm/ + migration: + # -- Indicate if migration is ongoing for multi zone ingester + enabled: false + # -- Exclude default zone on write path + excludeDefaultZone: false + # -- Enable zone-awareness, read path only + readPath: false + # -- Total number of replicas to start in availability zones when migration is enabled + replicas: 0 + # -- Scale default zone ingesters to 0 + scaleDownDefaultZone: false + # -- Enable zone-awareness, write path only + 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/ + - 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: {} + # -- 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: {} + # -- 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: {} + + # -- Add dynamic manifests via values. Example: # extraObjects: # - kind: ConfigMap @@ -3646,4 +3914,4 @@ continuous_test: # name: extra-cm-{{ .Release.Name }} # data: | # extra.yml: "does-my-install-need-extra-info: true" -extraObjects: [] +extraObjects: [] \ No newline at end of file