apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "loki.queryFrontendFullname" . }} namespace: {{ .Release.Namespace }} labels: {{- include "loki.queryFrontendLabels" . | nindent 4 }} {{- with .Values.loki.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if not .Values.queryFrontend.autoscaling.enabled }} replicas: {{ .Values.queryFrontend.replicas }} {{- end }} strategy: rollingUpdate: maxSurge: 0 maxUnavailable: 1 revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} selector: matchLabels: {{- include "loki.queryFrontendSelectorLabels" . | nindent 6 }} template: metadata: annotations: {{- include "loki.config.checksum" . | nindent 8 }} {{- with .Values.loki.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.queryFrontend.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "loki.queryFrontendSelectorLabels" . | nindent 8 }} {{- with .Values.loki.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.queryFrontend.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: serviceAccountName: {{ include "loki.serviceAccountName" . }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.queryFrontend.hostAliases }} hostAliases: {{- toYaml . | nindent 8 }} {{- end }} {{- include "loki.queryFrontendPriorityClassName" . | nindent 6 }} securityContext: {{- toYaml .Values.loki.podSecurityContext | nindent 8 }} terminationGracePeriodSeconds: {{ .Values.queryFrontend.terminationGracePeriodSeconds }} containers: - name: query-frontend image: {{ include "loki.queryFrontendImage" . }} imagePullPolicy: {{ .Values.loki.image.pullPolicy }} {{- if or .Values.loki.command .Values.queryFrontend.command }} command: - {{ coalesce .Values.queryFrontend.command .Values.loki.command | quote }} {{- end }} args: - -config.file=/etc/loki/config/config.yaml - -target=query-frontend {{- with .Values.queryFrontend.extraArgs }} {{- toYaml . | nindent 12 }} {{- end }} ports: - name: http containerPort: 3100 protocol: TCP - name: grpc containerPort: 9095 protocol: TCP {{- with .Values.queryFrontend.extraEnv }} env: {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.queryFrontend.extraEnvFrom }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} securityContext: {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }} readinessProbe: {{- toYaml .Values.loki.readinessProbe | nindent 12 }} livenessProbe: {{- toYaml .Values.loki.livenessProbe | nindent 12 }} volumeMounts: - name: config mountPath: /etc/loki/config - name: runtime-config mountPath: /var/{{ include "loki.name" . }}-runtime {{- with .Values.queryFrontend.extraVolumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} resources: {{- toYaml .Values.queryFrontend.resources | nindent 12 }} {{- if .Values.queryFrontend.extraContainers }} {{- toYaml .Values.queryFrontend.extraContainers | nindent 8}} {{- end }} {{- with .Values.queryFrontend.affinity }} affinity: {{- tpl . $ | nindent 8 }} {{- end }} {{- with .Values.queryFrontend.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.queryFrontend.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} volumes: - name: config {{- if .Values.loki.existingSecretForConfig }} secret: secretName: {{ .Values.loki.existingSecretForConfig }} {{- else if .Values.loki.configAsSecret }} secret: secretName: {{ include "loki.fullname" . }}-config {{- else }} configMap: name: {{ include "loki.fullname" . }} {{- end }} - name: runtime-config configMap: name: {{ template "loki.fullname" . }}-runtime {{- with .Values.queryFrontend.extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }}