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

helm: Add GEM federation-frontend resources #9673

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 @@ -29,6 +29,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
* [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
* [BUGFIX] Fix incorrect use of topology spread constraints in `GrafanaAgent` CRD of metamonitoring. #9669

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Enable enterprise features (required for federation-frontend)
enterprise:
enabled: true

# Enable and configure federation-frontend
federation_frontend:
enabled: true
replicas: 2
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 1
memory: 256Mi

mimir:
structuredConfig:
auth:
type: trust
instrumentation:
enabled: false
federation:
proxy_targets:
- name: "mimir-distributed-1"
url: "http://mimir-query-frontend.real-deployment.svc.cluster.local:8080/prometheus"
- name: "mimir-distributed-2"
url: "http://mimir-query-frontend.real-deployment.svc.cluster.local:8080/prometheus"

# Need the distributor so that the gateway can healthcheck it upon startup. This can be removed once the gateway can work without a distributor deployment.
distributor:
replicas: 1

# Disable all other components
alertmanager:
enabled: false
ingester:
replicas: 0
querier:
replicas: 0
query_frontend:
replicas: 0
query_scheduler:
enabled: false
compactor:
replicas: 0
store_gateway:
replicas: 0
ruler:
enabled: false
overrides_exporter:
enabled: false

# Disable all caches
admin-cache:
enabled: false
chunks-cache:
enabled: false
index-cache:
enabled: false
metadata-cache:
enabled: false
results-cache:
enabled: false

# Keep using minio to allow setting up the admin bucket
minio:
enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ Examples:
"compactor" "compactor"
"continuous-test" "continuous_test"
"distributor" "distributor"
"federation-frontend" "federation_frontend"
"gateway" "gateway"
"gr-aggr-cache" "gr-aggr-cache"
"gr-metricname-cache" "gr-metricname-cache"
Expand All @@ -438,8 +439,8 @@ Examples:
"index-cache" "index-cache"
"ingester" "ingester"
"memcached" "memcached"
"metadata-cache" "metadata-cache"
"meta-monitoring" "metaMonitoring.grafanaAgent"
"metadata-cache" "metadata-cache"
"nginx" "nginx"
"overrides-exporter" "overrides_exporter"
"querier" "querier"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{{- if and .Values.enterprise.enabled .Values.federation_frontend.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "federation-frontend") }}
labels:
{{- include "mimir.labels" (dict "ctx" . "component" "federation-frontend") | nindent 4 }}
annotations:
{{- toYaml .Values.federation_frontend.annotations | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
spec:
replicas: {{ .Values.federation_frontend.replicas }}
selector:
matchLabels:
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "federation-frontend" "memberlist" true) | nindent 6 }}
strategy:
{{- toYaml .Values.federation_frontend.strategy | nindent 4 }}
template:
metadata:
labels:
{{- include "mimir.podLabels" (dict "ctx" . "component" "federation-frontend" "memberlist" true) | nindent 8 }}
annotations:
{{- include "mimir.podAnnotations" (dict "ctx" . "component" "federation-frontend") | nindent 8 }}
spec:
serviceAccountName: {{ template "mimir.serviceAccountName" . }}
{{- if .Values.federation_frontend.priorityClassName }}
priorityClassName: {{ .Values.federation_frontend.priorityClassName }}
{{- end }}
securityContext:
{{- include "mimir.lib.podSecurityContext" (dict "ctx" . "component" "federation-frontend") | nindent 8 }}
{{- with .Values.federation_frontend.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: federation-frontend
image: {{ include "mimir.imageReference" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=federation-frontend"
- "-config.expand-env=true"
- "-config.file=/etc/mimir/mimir.yaml"
{{- range $key, $value := .Values.federation_frontend.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
volumeMounts:
{{- if .Values.federation_frontend.extraVolumeMounts }}
{{ toYaml .Values.federation_frontend.extraVolumeMounts | nindent 12}}
{{- end }}
{{- if .Values.global.extraVolumeMounts }}
{{ toYaml .Values.global.extraVolumeMounts | nindent 12}}
{{- end }}
- name: config
mountPath: /etc/mimir
- name: license
mountPath: /license
- name: runtime-config
mountPath: /var/{{ include "mimir.name" . }}
- name: active-queries
mountPath: /active-query-tracker
{{- if .Values.federation_frontend.extraVolumeMounts }}
{{- toYaml .Values.federation_frontend.extraVolumeMounts | nindent 12 }}
{{- end }}
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.federation_frontend.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.federation_frontend.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.federation_frontend.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.federation_frontend.containerSecurityContext | nindent 12 }}
{{- $jaeger_queue_size := dig "jaegerReporterMaxQueueSize" nil .Values.federation_frontend }}
{{- if or .Values.global.extraEnv .Values.federation_frontend.env $jaeger_queue_size }}
env:
{{- with .Values.global.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.federation_frontend.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if $jaeger_queue_size }}
- name: "JAEGER_REPORTER_MAX_QUEUE_SIZE"
value: {{$jaeger_queue_size | toString | toYaml }}
{{- end }}
{{- end }}
{{- if or .Values.global.extraEnvFrom .Values.federation_frontend.extraEnvFrom }}
envFrom:
{{- with .Values.global.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.federation_frontend.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.federation_frontend.extraContainers }}
{{ toYaml .Values.federation_frontend.extraContainers | nindent 8 }}
{{- end }}
{{- with .Values.federation_frontend.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.federation_frontend.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "mimir.lib.topologySpreadConstraints" (dict "ctx" . "component" "federation-frontend") | nindent 6 }}
{{- with .Values.federation_frontend.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.federation_frontend.terminationGracePeriodSeconds }}
volumes:
- name: config
{{- include "mimir.configVolume" . | nindent 10 }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
- name: runtime-config
configMap:
name: {{ template "mimir.fullname" . }}-runtime
{{- if .Values.federation_frontend.extraVolumes }}
{{- toYaml .Values.federation_frontend.extraVolumes | nindent 8 }}
{{- end }}
{{- if .Values.global.extraVolumes }}
{{ toYaml .Values.global.extraVolumes | nindent 8}}
{{- end }}
- name: active-queries
emptyDir: {}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- if and .Values.enterprise.enabled .Values.federation_frontend.enabled }}
{{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "federation-frontend" "memberlist" true) }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- if and .Values.enterprise.enabled .Values.federation_frontend.enabled }}
{{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "federation-frontend" "memberlist" true) }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if and .Values.enterprise.enabled .Values.federation_frontend.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "federation-frontend") }}
labels:
{{- include "mimir.labels" (dict "ctx" . "component" "federation-frontend" "memberlist" true) | nindent 4 }}
{{- with .Values.federation_frontend.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- toYaml .Values.federation_frontend.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" (dict "ctx" . "component" "federation-frontend" "memberlist" true) | nindent 4 }}
{{- end }}
83 changes: 83 additions & 0 deletions operations/helm/charts/mimir-distributed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ mimir:
ingester:
url: http://{{ template "mimir.fullname" . }}-ingester-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }}
query_frontend:
{{ if .Values.federation_frontend.enabled }}
url: http://{{ template "mimir.fullname" . }}-federation-frontend.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }}
{{ else }}
url: http://{{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }}
{{ end }}
ruler:
url: http://{{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }}
store_gateway:
Expand Down Expand Up @@ -4415,6 +4419,85 @@ gr-metricname-cache:
annotations: {}
labels: {}

federation_frontend:
# -- Specifies whether the federation-frontend should be enabled
enabled: false
# -- Number of replicas for the federation-frontend
replicas: 2
# -- Deployment strategy for the federation-frontend pods
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 15%

# -- Resource requests and limits for the federation-frontend
resources:
requests:
cpu: 100m
memory: 128Mi

initContainers: []

# -- Additional CLI arguments for the federation-frontend container
extraArgs: {}

# -- Additional environment variables for the federation-frontend container
env: []
# -- Additional volume mounts for the federation-frontend container
extraVolumeMounts: []
# -- Additional volumes for the federation-frontend pods
extraVolumes: []

# -- Additional containers to be added to the graphite-metric-name-cache pod.
extraContainers: []

# -- The name of the PriorityClass for federation-frontend pods
priorityClassName: null
# -- SecurityContext override for federation-frontend pods
securityContext: {}

# -- The SecurityContext for federation-frontend containers
containerSecurityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: [ALL]

# -- Grace period to allow the federation-frontend to shutdown before it is killed
terminationGracePeriodSeconds: 180
# -- Affinity configuration for federation-frontend pods
affinity: {}
# -- Node selector configuration for federation-frontend pods
nodeSelector: {}
# -- Tolerations for federation-frontend pods
tolerations: []
# -- Additional pod labels
podLabels: {}
# -- Additional pod annotations
podAnnotations: {}
# -- Additional annotations for the Deployment
annotations: {}
# -- Readiness probe configuration
readinessProbe:
httpGet:
path: /ready
port: http-metrics
initialDelaySeconds: 45
# -- Service configuration
service:
# -- Additional annotations for the federation-frontend service
annotations: {}
# -- Additional labels for the federation-frontend service
labels: {}
# -- Pod Disruption Budget configuration
podDisruptionBudget:
maxUnavailable: 1

# -- Jaeger reporter queue size
# Set to 'null' to use the Jaeger client's default value
jaegerReporterMaxQueueSize: null

# -- Settings for the smoke-test job. This is meant to run as a Helm test hook
# (`helm test RELEASE`) after installing the chart. It quickly verifies
# that writing and reading metrics works. Currently not supported for
Expand Down
Loading
Loading