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