deployment-query-scheduler.yaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {{- if .Values.queryScheduler.enabled }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ include "loki.querySchedulerFullname" . }}
  6. namespace: {{ .Release.Namespace }}
  7. labels:
  8. {{- include "loki.querySchedulerLabels" . | nindent 4 }}
  9. {{- with .Values.loki.annotations }}
  10. annotations:
  11. {{- toYaml . | nindent 4 }}
  12. {{- end }}
  13. spec:
  14. replicas: {{ .Values.queryScheduler.replicas }}
  15. strategy:
  16. rollingUpdate:
  17. maxSurge: 0
  18. maxUnavailable: 1
  19. revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
  20. selector:
  21. matchLabels:
  22. {{- include "loki.querySchedulerSelectorLabels" . | nindent 6 }}
  23. template:
  24. metadata:
  25. annotations:
  26. {{- include "loki.config.checksum" . | nindent 8 }}
  27. {{- with .Values.loki.podAnnotations }}
  28. {{- toYaml . | nindent 8 }}
  29. {{- end }}
  30. {{- with .Values.queryScheduler.podAnnotations }}
  31. {{- toYaml . | nindent 8 }}
  32. {{- end }}
  33. labels:
  34. {{- include "loki.querySchedulerSelectorLabels" . | nindent 8 }}
  35. {{- with .Values.loki.podLabels }}
  36. {{- toYaml . | nindent 8 }}
  37. {{- end }}
  38. {{- with .Values.queryScheduler.podLabels }}
  39. {{- toYaml . | nindent 8 }}
  40. {{- end }}
  41. spec:
  42. serviceAccountName: {{ include "loki.serviceAccountName" . }}
  43. {{- with .Values.imagePullSecrets }}
  44. imagePullSecrets:
  45. {{- toYaml . | nindent 8 }}
  46. {{- end }}
  47. {{- with .Values.queryScheduler.hostAliases }}
  48. hostAliases:
  49. {{- toYaml . | nindent 8 }}
  50. {{- end }}
  51. {{- include "loki.querySchedulerPriorityClassName" . | nindent 6 }}
  52. securityContext:
  53. {{- toYaml .Values.loki.podSecurityContext | nindent 8 }}
  54. terminationGracePeriodSeconds: {{ .Values.queryScheduler.terminationGracePeriodSeconds }}
  55. containers:
  56. - name: query-scheduler
  57. image: {{ include "loki.querySchedulerImage" . }}
  58. imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
  59. args:
  60. - -config.file=/etc/loki/config/config.yaml
  61. - -target=query-scheduler
  62. {{- with .Values.queryScheduler.extraArgs }}
  63. {{- toYaml . | nindent 12 }}
  64. {{- end }}
  65. ports:
  66. - name: http
  67. containerPort: 3100
  68. protocol: TCP
  69. - name: grpc
  70. containerPort: 9095
  71. protocol: TCP
  72. {{- with .Values.queryScheduler.extraEnv }}
  73. env:
  74. {{- toYaml . | nindent 12 }}
  75. {{- end }}
  76. {{- with .Values.queryScheduler.extraEnvFrom }}
  77. envFrom:
  78. {{- toYaml . | nindent 12 }}
  79. {{- end }}
  80. securityContext:
  81. {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
  82. readinessProbe:
  83. {{- toYaml .Values.loki.readinessProbe | nindent 12 }}
  84. livenessProbe:
  85. {{- toYaml .Values.loki.livenessProbe | nindent 12 }}
  86. volumeMounts:
  87. - name: config
  88. mountPath: /etc/loki/config
  89. - name: runtime-config
  90. mountPath: /var/{{ include "loki.name" . }}-runtime
  91. {{- with .Values.queryScheduler.extraVolumeMounts }}
  92. {{- toYaml . | nindent 12 }}
  93. {{- end }}
  94. {{- with .Values.queryScheduler.resources }}
  95. resources:
  96. {{- toYaml . | nindent 12 }}
  97. {{- end }}
  98. {{- if .Values.queryScheduler.extraContainers }}
  99. {{- toYaml .Values.queryScheduler.extraContainers | nindent 8}}
  100. {{- end }}
  101. {{- with .Values.queryScheduler.affinity }}
  102. affinity:
  103. {{- tpl . $ | nindent 8 }}
  104. {{- end }}
  105. {{- with .Values.queryScheduler.nodeSelector }}
  106. nodeSelector:
  107. {{- toYaml . | nindent 8 }}
  108. {{- end }}
  109. {{- with .Values.queryScheduler.tolerations }}
  110. tolerations:
  111. {{- toYaml . | nindent 8 }}
  112. {{- end }}
  113. volumes:
  114. - name: config
  115. {{- if .Values.loki.existingSecretForConfig }}
  116. secret:
  117. secretName: {{ .Values.loki.existingSecretForConfig }}
  118. {{- else if .Values.loki.configAsSecret }}
  119. secret:
  120. secretName: {{ include "loki.fullname" . }}-config
  121. {{- else }}
  122. configMap:
  123. name: {{ include "loki.fullname" . }}
  124. {{- end }}
  125. - name: runtime-config
  126. configMap:
  127. name: {{ template "loki.fullname" . }}-runtime
  128. {{- with .Values.queryScheduler.extraVolumes }}
  129. {{- toYaml . | nindent 8 }}
  130. {{- end }}
  131. {{- end }}