Files
2026-08-26 03:39:42 +05:30

151 lines
5.9 KiB
YAML

{{- if .Values.enterprise.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
{{- toYaml .Values.admin_api.annotations | nindent 4 }}
labels:
{{- include "mimir.labels" (dict "ctx" . "component" "admin-api" "memberlist" true) | nindent 4 }}
name: {{ include "mimir.resourceName" (dict "ctx" . "component" "admin-api") }}
namespace: {{ .Release.Namespace | quote }}
spec:
replicas: {{ .Values.admin_api.replicas }}
selector:
matchLabels:
{{- include "mimir.selectorLabels" (dict "ctx" . "component" "admin-api" "memberlist" true) | nindent 6 }}
strategy:
{{- toYaml .Values.admin_api.strategy | nindent 4 }}
template:
metadata:
labels:
{{- include "mimir.podLabels" (dict "ctx" . "component" "admin-api" "memberlist" true) | nindent 8 }}
annotations:
{{- include "mimir.podAnnotations" (dict "ctx" . "component" "admin-api") | nindent 8 }}
namespace: {{ .Release.Namespace | quote }}
spec:
serviceAccountName: {{ template "mimir.serviceAccountName" . }}
{{- if .Values.admin_api.priorityClassName }}
priorityClassName: {{ .Values.admin_api.priorityClassName }}
{{- end }}
securityContext:
{{- include "mimir.lib.podSecurityContext" (dict "ctx" . "component" "admin-api") | nindent 8 }}
{{- with .Values.admin_api.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: admin-api
image: "{{ include "mimir.imageReference" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=admin-api"
- "-config.expand-env=true"
- "-config.file=/etc/mimir/mimir.yaml"
{{- range $key, $value := .Values.admin_api.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
volumeMounts:
{{- if .Values.admin_api.extraVolumeMounts }}
{{ toYaml .Values.admin_api.extraVolumeMounts | nindent 12}}
{{- end }}
{{- if .Values.global.extraVolumeMounts }}
{{ toYaml .Values.global.extraVolumeMounts | nindent 12}}
{{- end }}
- name: config
mountPath: /etc/mimir
- name: runtime-config
mountPath: /var/{{ include "mimir.name" . }}
- name: license
mountPath: /license
- name: storage
mountPath: "/data"
{{- if .Values.admin_api.persistence.subPath }}
subPath: {{ .Values.admin_api.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.admin_api.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.admin_api.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.admin_api.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.admin_api.containerSecurityContext | nindent 12 }}
{{- $jaeger_queue_size := dig "jaegerReporterMaxQueueSize" nil .Values.admin_api }}
{{- if or .Values.global.extraEnv .Values.admin_api.env $jaeger_queue_size }}
env:
{{- with .Values.global.extraEnv }}
{{ toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.admin_api.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.admin_api.extraEnvFrom }}
envFrom:
{{- with .Values.global.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.admin_api.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.admin_api.extraContainers }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.admin_api.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.admin_api.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "mimir.lib.topologySpreadConstraints" (dict "ctx" . "component" "admin-api") | nindent 6 }}
{{- with .Values.admin_api.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.admin_api.terminationGracePeriodSeconds }}
volumes:
- name: config
{{- include "mimir.configVolume" . | nindent 10 }}
- name: runtime-config
configMap:
name: {{ template "mimir.fullname" . }}-runtime
{{- if .Values.admin_api.extraVolumes }}
{{ toYaml .Values.admin_api.extraVolumes | nindent 8}}
{{- end }}
{{- if .Values.global.extraVolumes }}
{{ toYaml .Values.global.extraVolumes | nindent 8}}
{{- end }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
- name: storage
emptyDir: {}
- name: active-queries
emptyDir: {}
{{- end -}}