deployment-querier.yaml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. {{- if .Values.indexGateway.enabled }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ include "loki.querierFullname" . }}
  6. namespace: {{ .Release.Namespace }}
  7. labels:
  8. {{- include "loki.querierLabels" . | nindent 4 }}
  9. app.kubernetes.io/part-of: memberlist
  10. {{- with .Values.loki.annotations }}
  11. annotations:
  12. {{- toYaml . | nindent 4 }}
  13. {{- end }}
  14. spec:
  15. {{- if not .Values.querier.autoscaling.enabled }}
  16. replicas: {{ .Values.querier.replicas }}
  17. {{- end }}
  18. strategy:
  19. rollingUpdate:
  20. maxSurge: {{ .Values.querier.maxSurge }}
  21. maxUnavailable: 1
  22. revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
  23. selector:
  24. matchLabels:
  25. {{- include "loki.querierSelectorLabels" . | nindent 6 }}
  26. template:
  27. metadata:
  28. annotations:
  29. {{- include "loki.config.checksum" . | nindent 8 }}
  30. {{- with .Values.loki.podAnnotations }}
  31. {{- toYaml . | nindent 8 }}
  32. {{- end }}
  33. {{- with .Values.querier.podAnnotations }}
  34. {{- toYaml . | nindent 8 }}
  35. {{- end }}
  36. labels:
  37. {{- include "loki.querierSelectorLabels" . | nindent 8 }}
  38. app.kubernetes.io/part-of: memberlist
  39. {{- with .Values.loki.podLabels }}
  40. {{- toYaml . | nindent 8 }}
  41. {{- end }}
  42. {{- with .Values.querier.podLabels }}
  43. {{- toYaml . | nindent 8 }}
  44. {{- end }}
  45. spec:
  46. {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
  47. {{- with .Values.querier.topologySpreadConstraints }}
  48. topologySpreadConstraints:
  49. {{- tpl . $ | nindent 8 }}
  50. {{- end }}
  51. {{- end }}
  52. serviceAccountName: {{ include "loki.serviceAccountName" . }}
  53. {{- with .Values.imagePullSecrets }}
  54. imagePullSecrets:
  55. {{- toYaml . | nindent 8 }}
  56. {{- end }}
  57. {{- with .Values.querier.hostAliases }}
  58. hostAliases:
  59. {{- toYaml . | nindent 8 }}
  60. {{- end }}
  61. {{- include "loki.querierPriorityClassName" . | nindent 6 }}
  62. securityContext:
  63. {{- toYaml .Values.loki.podSecurityContext | nindent 8 }}
  64. terminationGracePeriodSeconds: {{ .Values.querier.terminationGracePeriodSeconds }}
  65. {{- with .Values.querier.initContainers }}
  66. initContainers:
  67. {{- toYaml . | nindent 8 }}
  68. {{- end }}
  69. containers:
  70. - name: querier
  71. image: {{ include "loki.querierImage" . }}
  72. imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
  73. args:
  74. - -config.file=/etc/loki/config/config.yaml
  75. - -target=querier
  76. {{- with .Values.querier.extraArgs }}
  77. {{- toYaml . | nindent 12 }}
  78. {{- end }}
  79. ports:
  80. - name: http
  81. containerPort: 3100
  82. protocol: TCP
  83. - name: grpc
  84. containerPort: 9095
  85. protocol: TCP
  86. - name: http-memberlist
  87. containerPort: 7946
  88. protocol: TCP
  89. {{- with .Values.querier.extraEnv }}
  90. env:
  91. {{- toYaml . | nindent 12 }}
  92. {{- end }}
  93. {{- with .Values.querier.extraEnvFrom }}
  94. envFrom:
  95. {{- toYaml . | nindent 12 }}
  96. {{- end }}
  97. securityContext:
  98. {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
  99. readinessProbe:
  100. {{- toYaml .Values.loki.readinessProbe | nindent 12 }}
  101. livenessProbe:
  102. {{- toYaml .Values.loki.livenessProbe | nindent 12 }}
  103. volumeMounts:
  104. - name: config
  105. mountPath: /etc/loki/config
  106. - name: runtime-config
  107. mountPath: /var/{{ include "loki.name" . }}-runtime
  108. - name: data
  109. mountPath: /var/loki
  110. {{- with .Values.querier.extraVolumeMounts }}
  111. {{- toYaml . | nindent 12 }}
  112. {{- end }}
  113. resources:
  114. {{- toYaml .Values.querier.resources | nindent 12 }}
  115. {{- if .Values.querier.extraContainers }}
  116. {{- toYaml .Values.querier.extraContainers | nindent 8}}
  117. {{- end }}
  118. {{- with .Values.querier.affinity }}
  119. affinity:
  120. {{- tpl . $ | nindent 8 }}
  121. {{- end }}
  122. {{- with .Values.querier.nodeSelector }}
  123. nodeSelector:
  124. {{- toYaml . | nindent 8 }}
  125. {{- end }}
  126. {{- with .Values.querier.tolerations }}
  127. tolerations:
  128. {{- toYaml . | nindent 8 }}
  129. {{- end }}
  130. {{- with .Values.querier.dnsConfig }}
  131. dnsConfig:
  132. {{- toYaml . | nindent 8 }}
  133. {{- end }}
  134. volumes:
  135. - name: config
  136. {{- if .Values.loki.existingSecretForConfig }}
  137. secret:
  138. secretName: {{ .Values.loki.existingSecretForConfig }}
  139. {{- else if .Values.loki.configAsSecret }}
  140. secret:
  141. secretName: {{ include "loki.fullname" . }}-config
  142. {{- else }}
  143. configMap:
  144. name: {{ include "loki.fullname" . }}
  145. {{- end }}
  146. - name: runtime-config
  147. configMap:
  148. name: {{ template "loki.fullname" . }}-runtime
  149. - name: data
  150. emptyDir: {}
  151. {{- with .Values.querier.extraVolumes }}
  152. {{- toYaml . | nindent 8 }}
  153. {{- end }}
  154. {{- end }}