deployment-query-frontend.yaml 4.7 KB

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