172 lines
6.8 KiB
YAML
172 lines
6.8 KiB
YAML
{{- if .Values.ruler.enabled -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "ruler") }}
|
|
labels:
|
|
{{- include "mimir.labels" (dict "ctx" . "component" "ruler" "memberlist" true) | nindent 4 }}
|
|
annotations:
|
|
{{- toYaml .Values.ruler.annotations | nindent 4 }}
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
spec:
|
|
{{- if or (not .Values.ruler.kedaAutoscaling.enabled) (.Values.ruler.kedaAutoscaling.preserveReplicas) }}
|
|
replicas: {{ .Values.ruler.replicas }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "ruler" "memberlist" true) | nindent 6 }}
|
|
strategy:
|
|
{{- toYaml .Values.ruler.strategy | nindent 4 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "mimir.podLabels" (dict "ctx" . "component" "ruler" "memberlist" true) | nindent 8 }}
|
|
annotations:
|
|
{{- include "mimir.podAnnotations" (dict "ctx" . "component" "ruler") | nindent 8 }}
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
spec:
|
|
serviceAccountName: {{ template "mimir.ruler.serviceAccountName" . }}
|
|
{{- if .Values.ruler.priorityClassName }}
|
|
priorityClassName: {{ .Values.ruler.priorityClassName }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- include "mimir.lib.podSecurityContext" (dict "ctx" . "component" "ruler") | nindent 8 }}
|
|
{{- with .Values.ruler.initContainers }}
|
|
initContainers:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.image.pullSecrets }}
|
|
imagePullSecrets:
|
|
{{- range .Values.image.pullSecrets }}
|
|
- name: {{ . }}
|
|
{{- end}}
|
|
{{- end }}
|
|
containers:
|
|
- name: ruler
|
|
image: "{{ include "mimir.imageReference" . }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
args:
|
|
- "-target=ruler"
|
|
- "-config.expand-env=true"
|
|
- "-config.file=/etc/mimir/mimir.yaml"
|
|
- "-distributor.remote-timeout=10s"
|
|
{{- if .Values.ingester.zoneAwareReplication.migration.enabled }}
|
|
{{- if not .Values.ingester.zoneAwareReplication.migration.writePath }}
|
|
- "-ingester.ring.zone-awareness-enabled=false"
|
|
{{- end }}
|
|
{{- if .Values.ingester.zoneAwareReplication.migration.excludeDefaultZone }}
|
|
- "-ingester.ring.excluded-zones=zone-default"
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.store_gateway.zoneAwareReplication.migration.enabled }}
|
|
{{- if not .Values.store_gateway.zoneAwareReplication.migration.readPath }}
|
|
- "-store-gateway.sharding-ring.prefix=collectors/"
|
|
- "-store-gateway.sharding-ring.zone-awareness-enabled=false"
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- range $key, $value := .Values.ruler.extraArgs }}
|
|
- "-{{ $key }}={{ $value }}"
|
|
{{- end }}
|
|
volumeMounts:
|
|
{{- if .Values.ruler.extraVolumeMounts }}
|
|
{{ toYaml .Values.ruler.extraVolumeMounts | nindent 12}}
|
|
{{- end }}
|
|
{{- if .Values.global.extraVolumeMounts }}
|
|
{{ toYaml .Values.global.extraVolumeMounts | nindent 12}}
|
|
{{- end }}
|
|
- name: config
|
|
mountPath: /etc/mimir
|
|
{{- if .Values.enterprise.enabled }}
|
|
- name: license
|
|
mountPath: /license
|
|
{{- end }}
|
|
- name: runtime-config
|
|
mountPath: /var/{{ include "mimir.name" . }}
|
|
- name: storage
|
|
mountPath: "/data"
|
|
{{- if .Values.ruler.persistence.subPath }}
|
|
subPath: {{ .Values.ruler.persistence.subPath }}
|
|
{{- 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.ruler.livenessProbe | nindent 12 }}
|
|
readinessProbe:
|
|
{{- toYaml .Values.ruler.readinessProbe | nindent 12 }}
|
|
resources:
|
|
{{- toYaml .Values.ruler.resources | nindent 12 }}
|
|
securityContext:
|
|
{{- toYaml .Values.ruler.containerSecurityContext | nindent 12 }}
|
|
{{- $jaeger_queue_size := dig "jaegerReporterMaxQueueSize" nil .Values.ruler }}
|
|
{{- if or .Values.global.extraEnv .Values.ruler.env $jaeger_queue_size }}
|
|
env:
|
|
{{- with .Values.global.extraEnv }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.ruler.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.ruler.extraEnvFrom }}
|
|
envFrom:
|
|
{{- with .Values.global.extraEnvFrom }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.ruler.extraEnvFrom }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.ruler.extraContainers }}
|
|
{{ toYaml .Values.ruler.extraContainers | indent 8}}
|
|
{{- end }}
|
|
{{- with .Values.ruler.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.ruler.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- include "mimir.lib.topologySpreadConstraints" (dict "ctx" . "component" "ruler") | nindent 6 }}
|
|
{{- with .Values.ruler.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
terminationGracePeriodSeconds: {{ .Values.ruler.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 .Values.ruler.extraVolumes }}
|
|
{{ toYaml .Values.ruler.extraVolumes | nindent 8}}
|
|
{{- end }}
|
|
{{- if .Values.global.extraVolumes }}
|
|
{{ toYaml .Values.global.extraVolumes | nindent 8}}
|
|
{{- end }}
|
|
- name: storage
|
|
emptyDir: {}
|
|
- name: active-queries
|
|
emptyDir: {}
|
|
{{- end -}}
|