added repo

This commit is contained in:
Your Name
2026-08-26 03:39:42 +05:30
parent 45c25a95af
commit b8575bb8b9
6889 changed files with 1217125 additions and 0 deletions
@@ -0,0 +1,171 @@
{{- 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 -}}
@@ -0,0 +1,3 @@
{{- if .Values.ruler.enabled -}}
{{- include "mimir.lib.podDisruptionBudget" (dict "ctx" $ "component" "ruler" "memberlist" true) }}
{{- end -}}
@@ -0,0 +1,14 @@
{{- if .Values.ruler.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "mimir.ruler.serviceAccountName" . }}
labels:
{{- include "mimir.labels" (dict "ctx" .) | nindent 4 }}
{{- with .Values.ruler.serviceAccount.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- toYaml .Values.ruler.serviceAccount.annotations | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}
@@ -0,0 +1,3 @@
{{- if .Values.ruler.enabled -}}
{{- include "mimir.lib.serviceMonitor" (dict "ctx" $ "component" "ruler" "memberlist" true) }}
{{- end -}}
@@ -0,0 +1,44 @@
{{- if .Values.ruler.kedaAutoscaling.enabled }}
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "ruler") }}
labels:
{{- include "mimir.labels" (dict "ctx" . "component" "ruler") | nindent 4 }}
annotations:
{{- toYaml .Values.ruler.annotations | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
spec:
advanced:
horizontalPodAutoscalerConfig:
{{- with .Values.ruler.kedaAutoscaling.behavior }}
behavior:
{{- toYaml . | nindent 8 }}
{{- end }}
maxReplicaCount: {{ .Values.ruler.kedaAutoscaling.maxReplicaCount }}
minReplicaCount: {{ .Values.ruler.kedaAutoscaling.minReplicaCount }}
pollingInterval: {{ .Values.kedaAutoscaling.pollingInterval }}
scaleTargetRef:
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "ruler") }}
apiVersion: apps/v1
kind: Deployment
triggers:
- metadata:
query: max_over_time(sum(sum by (pod) (rate(container_cpu_usage_seconds_total{container="ruler",namespace="{{ .Release.Namespace }}"}[5m])) and max by (pod) (up{container="ruler",namespace="{{ .Release.Namespace }}"}) > 0)[15m:]) * 1000
serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }}
{{- $cpu_request := dig "requests" "cpu" nil .Values.ruler.resources }}
threshold: {{ mulf (include "mimir.cpuToMilliCPU" (dict "value" $cpu_request)) (divf .Values.ruler.kedaAutoscaling.targetCPUUtilizationPercentage 100) | floor | int64 | quote }}
{{- if .Values.kedaAutoscaling.customHeaders }}
customHeaders: {{ (include "mimir.lib.mapToCSVString" (dict "map" .Values.kedaAutoscaling.customHeaders)) | quote }}
{{- end }}
type: prometheus
- metadata:
query: max_over_time(sum((sum by (pod) (container_memory_working_set_bytes{container="ruler",namespace="{{ .Release.Namespace }}"}) and max by (pod) (up{container="ruler",namespace="{{ .Release.Namespace }}"}) > 0) or vector(0))[15m:]) + sum(sum by (pod) (max_over_time(kube_pod_container_resource_requests{container="ruler",namespace="{{ .Release.Namespace }}", resource="memory"}[15m])) and max by (pod) (changes(kube_pod_container_status_restarts_total{container="ruler",namespace="{{ .Release.Namespace }}"}[15m]) > 0) and max by (pod) (kube_pod_container_status_last_terminated_reason{container="ruler",namespace="{{ .Release.Namespace }}", reason="OOMKilled"}) or vector(0))
serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }}
{{- $mem_request := dig "requests" "memory" nil .Values.ruler.resources }}
threshold: {{ mulf (include "mimir.siToBytes" (dict "value" $mem_request)) (divf .Values.ruler.kedaAutoscaling.targetMemoryUtilizationPercentage 100) | floor | int64 | quote }}
{{- if .Values.kedaAutoscaling.customHeaders }}
customHeaders: {{ (include "mimir.lib.mapToCSVString" (dict "map" .Values.kedaAutoscaling.customHeaders)) | quote }}
{{- end }}
type: prometheus
{{- end }}
@@ -0,0 +1,23 @@
{{- if .Values.ruler.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "ruler") }}
labels:
{{- include "mimir.labels" (dict "ctx" . "component" "ruler" "memberlist" true) | nindent 4 }}
{{- with .Values.ruler.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- toYaml .Values.ruler.service.annotations | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
spec:
type: ClusterIP
ports:
- port: {{ include "mimir.serverHttpListenPort" . }}
protocol: TCP
name: http-metrics
targetPort: http-metrics
selector:
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "ruler" "memberlist" true) | nindent 4 }}
{{- end -}}