Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to introduce a monolithic deployment with Helm #4858

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions operations/helm/charts/mimir-distributed/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Entries should include a reference to the Pull Request that introduced the chang
## main / unreleased

* [FEATURE] Add support for GEM's federation-frontend. See the `federation_frontend` section in the values file. #9673
* [FEATURE] Support monolithic deployment with the helm chart. #4832
* [ENHANCEMENT] Add support for setting type and internal traffic policy for Kubernetes service. Set `internalTrafficPolicy=Cluster` by default in all services with type `ClusterIP`. #9619
* [ENHANCEMENT] Add the possibility to create a dedicated serviceAccount for the `alertmanager` component by setting `alertmanager.serviceAcount.create` to true in the values. #9781
* [ENHANCEMENT] helm: add `enabled` field for admin-api, compactor, distributor, gateway, ingester, querier, query-frontend and store-gateway components. This helps when deploying the GEM federation-frontend on its own. #9734
Expand Down
81 changes: 81 additions & 0 deletions operations/helm/charts/mimir-distributed/monolithic.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ Examples:
*/}}
{{- define "mimir.componentSectionFromName" -}}
{{- $componentsMap := dict
"monolithic" "monolithic"
"admin-api" "admin_api"
"admin-cache" "admin-cache"
"alertmanager" "alertmanager"
Expand Down Expand Up @@ -487,6 +488,7 @@ mimir.vaultAgent.annotations takes 2 arguments
*/}}
{{- define "mimir.vaultAgent.annotations" -}}
{{- $vaultEnabledComponents := dict
"monolithic" true
"admin-api" true
"alertmanager" true
"compactor" true
Expand Down Expand Up @@ -577,7 +579,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 -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if has .Values.deploymentMode (list "microservices" "monolithic")}}
{{- if and .Values.alertmanager.enabled (not .Values.federation_frontend.disableOtherComponents) -}}
{{- if .Values.alertmanager.fallbackConfig -}}
apiVersion: v1
Expand All @@ -14,3 +15,4 @@ data:
{{- .Values.alertmanager.fallbackConfig | nindent 4 }}
{{- end -}}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if has .Values.deploymentMode (list "microservices" "monolithic")}}
{{- if and .Values.alertmanager.enabled (not .Values.federation_frontend.disableOtherComponents) -}}
{{- if not .Values.alertmanager.statefulSet.enabled -}}
apiVersion: apps/v1
Expand Down Expand Up @@ -165,3 +166,4 @@ spec:
{{- end }}
{{- end -}}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if has .Values.deploymentMode (list "microservices" "monolithic")}}
{{- if and .Values.alertmanager.enabled (not .Values.federation_frontend.disableOtherComponents) -}}
{{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "alertmanager" "memberlist" true) }}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if has .Values.deploymentMode (list "microservices" "monolithic")}}
{{- if and .Values.alertmanager.enabled (not .Values.federation_frontend.disableOtherComponents) -}}
{{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "alertmanager" "memberlist" true) }}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if has .Values.deploymentMode (list "microservices" "monolithic")}}
{{- if and .Values.alertmanager.enabled (not .Values.federation_frontend.disableOtherComponents) -}}
{{- if .Values.alertmanager.statefulSet.enabled -}}
{{- $args := dict "ctx" . "component" "alertmanager" "memberlist" true -}}
Expand Down Expand Up @@ -230,3 +231,4 @@ spec:
{{ end }}
{{ end }}
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if has .Values.deploymentMode (list "microservices" "monolithic")}}
{{- if and .Values.alertmanager.enabled (not .Values.federation_frontend.disableOtherComponents) -}}
{{- $clusterPort := regexReplaceAll ".+[:]" (default "0.0.0.0:9094" (include "mimir.alertmanagerClusterBindAddress" .) ) "" -}}
apiVersion: v1
Expand Down Expand Up @@ -32,3 +33,4 @@ spec:
selector:
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "alertmanager" "memberlist" true) | nindent 4 }}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if has .Values.deploymentMode (list "microservices" "monolithic")}}
{{- if and .Values.alertmanager.enabled (not .Values.federation_frontend.disableOtherComponents) -}}
{{- $args := dict "ctx" . "component" "alertmanager" "memberlist" true -}}
{{- $zonesMap := include "mimir.zoneAwareReplicationMap" $args | fromYaml -}}
Expand Down Expand Up @@ -41,3 +42,4 @@ spec:
{{ end }}
{{ end }}
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- include "mimir.memcached.statefulSet" (dict "ctx" $ "component" "chunks-cache" ) }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- include "mimir.memcached.service" (dict "ctx" $ "component" "chunks-cache" ) }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.compactor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
{{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "compactor" "memberlist" true) }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.compactor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
{{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "compactor" "memberlist" true) }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.compactor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
apiVersion: apps/v1
kind: StatefulSet
Expand Down Expand Up @@ -188,3 +189,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.compactor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -28,3 +29,4 @@ spec:
selector:
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "compactor" "memberlist" true) | nindent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.distributor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -178,3 +179,4 @@ spec:
- name: active-queries
emptyDir: {}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.distributor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
{{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "distributor" "memberlist" true) }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.distributor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
{{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "distributor" "memberlist" true) }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.distributor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -27,3 +28,4 @@ spec:
selector:
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "distributor" "memberlist" true) | nindent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and .Values.distributor.enabled (not .Values.federation_frontend.disableOtherComponents) }}
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -28,3 +29,4 @@ spec:
selector:
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "distributor" "memberlist" true) | nindent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if (eq (include "mimir.gateway.isEnabled" .) "true") }}
{{- with .Values.gateway }}
{{- $isGEMGateway := $.Values.enterprise.enabled -}}
Expand Down Expand Up @@ -194,3 +195,4 @@ spec:
{{- end }}
{{- end -}}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -42,3 +43,4 @@ spec:
{{- end }}
{{- end }}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if .Values.gateway.route.enabled }}
kind: Route
apiVersion: route.openshift.io/v1
Expand All @@ -23,3 +24,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if eq (include "mimir.gateway.isEnabled" .) "true" -}}
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -39,3 +40,4 @@ spec:
selector:
{{- include "mimir.selectorLabels" (dict "ctx" $ "component" "gateway") | nindent 4 }}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -33,3 +34,4 @@ spec:
{{- end }}
{{- end -}}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -29,3 +30,4 @@ spec:
{{- end }}
{{- end -}}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- if and (not .Values.enterprise.enabled) .Values.gateway.enabledNonEnterprise -}}
apiVersion: v1
kind: ConfigMap
Expand All @@ -10,3 +11,4 @@ data:
nginx.conf: |
{{- tpl .Values.gateway.nginx.config.file . | nindent 4 }}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,3 +13,4 @@ stringData:
{{- tpl .Values.gateway.nginx.basicAuth.htpasswd $ | nindent 4 }}
{{- end -}}
{{- end -}}
{{- end }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{{- if eq .Values.deploymentMode "microservices" }}
{{- include "mimir.memcached.statefulSet" (dict "ctx" $ "component" "index-cache" ) }}
{{- end }}
Loading