statefulset-ingester.yaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. {{ $dict := dict "ctx" . "component" "ingester" "memberlist" true }}
  2. apiVersion: apps/v1
  3. kind: StatefulSet
  4. metadata:
  5. name: {{ template "tempo.resourceName" $dict }}
  6. namespace: {{ .Release.Namespace }}
  7. labels:
  8. {{- include "tempo.labels" $dict | nindent 4 }}
  9. {{- with .Values.ingester.annotations }}
  10. annotations:
  11. {{- toYaml . | nindent 4 }}
  12. {{- end }}
  13. spec:
  14. {{- if not .Values.ingester.autoscaling.enabled }}
  15. replicas: {{ .Values.ingester.replicas }}
  16. {{- end }}
  17. selector:
  18. matchLabels:
  19. {{- include "tempo.selectorLabels" $dict | nindent 6}}
  20. serviceName: ingester
  21. podManagementPolicy: Parallel
  22. updateStrategy:
  23. rollingUpdate:
  24. partition: 0
  25. template:
  26. metadata:
  27. labels:
  28. {{- include "tempo.podLabels" $dict | nindent 8 }}
  29. {{- with .Values.tempo.podLabels }}
  30. {{- toYaml . | nindent 8 }}
  31. {{- end }}
  32. {{- with .Values.ingester.podLabels }}
  33. {{- toYaml . | nindent 8 }}
  34. {{- end }}
  35. annotations:
  36. checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
  37. {{- with .Values.tempo.podAnnotations }}
  38. {{- toYaml . | nindent 8 }}
  39. {{- end }}
  40. {{- with .Values.ingester.podAnnotations }}
  41. {{- toYaml . | nindent 8 }}
  42. {{- end }}
  43. spec:
  44. {{- if or (.Values.ingester.priorityClassName) (.Values.global.priorityClassName) }}
  45. priorityClassName: {{ default .Values.ingester.priorityClassName .Values.global.priorityClassName }}
  46. {{- end }}
  47. serviceAccountName: {{ include "tempo.serviceAccountName" . }}
  48. {{- with .Values.tempo.podSecurityContext }}
  49. securityContext:
  50. {{- toYaml . | nindent 8 }}
  51. {{- end }}
  52. enableServiceLinks: false
  53. {{- include "tempo.ingesterImagePullSecrets" . | nindent 6 -}}
  54. {{- with .Values.ingester.hostAliases }}
  55. hostAliases:
  56. {{- toYaml . | nindent 8 }}
  57. {{- end }}
  58. containers:
  59. - args:
  60. - -target=ingester
  61. - -config.file=/conf/tempo.yaml
  62. - -mem-ballast-size-mbs=1024
  63. {{- with .Values.ingester.extraArgs }}
  64. {{- toYaml . | nindent 12 }}
  65. {{- end }}
  66. image: {{ include "tempo.imageReference" $dict }}
  67. imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
  68. name: ingester
  69. ports:
  70. - name: grpc
  71. containerPort: 9095
  72. - name: http-memberlist
  73. containerPort: 7946
  74. - name: http-metrics
  75. containerPort: 3100
  76. {{- with .Values.ingester.extraEnv }}
  77. env:
  78. {{- toYaml . | nindent 12 }}
  79. {{- end }}
  80. {{- with .Values.ingester.extraEnvFrom }}
  81. envFrom:
  82. {{- toYaml . | nindent 12 }}
  83. {{- end }}
  84. readinessProbe:
  85. {{- toYaml .Values.tempo.readinessProbe | nindent 12 }}
  86. resources:
  87. {{- toYaml .Values.ingester.resources | nindent 12 }}
  88. {{- with .Values.tempo.securityContext }}
  89. securityContext:
  90. {{- toYaml . | nindent 12 }}
  91. {{- end }}
  92. volumeMounts:
  93. - mountPath: /conf
  94. name: config
  95. - mountPath: /runtime-config
  96. name: runtime-config
  97. - mountPath: /var/tempo
  98. name: data
  99. {{- if .Values.enterprise.enabled }}
  100. - name: license
  101. mountPath: /license
  102. {{- end }}
  103. {{- with .Values.ingester.extraVolumeMounts }}
  104. {{- toYaml . | nindent 12 }}
  105. {{- end }}
  106. terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
  107. {{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
  108. {{- with .Values.ingester.topologySpreadConstraints }}
  109. topologySpreadConstraints:
  110. {{- tpl . $ | nindent 8 }}
  111. {{- end }}
  112. {{- end }}
  113. {{- with .Values.ingester.affinity }}
  114. affinity:
  115. {{- tpl . $ | nindent 8 }}
  116. {{- end }}
  117. {{- with .Values.ingester.nodeSelector }}
  118. nodeSelector:
  119. {{- toYaml . | nindent 8 }}
  120. {{- end }}
  121. {{- with .Values.ingester.tolerations }}
  122. tolerations:
  123. {{- toYaml . | nindent 8 }}
  124. {{- end }}
  125. volumes:
  126. - name: config
  127. {{- include "tempo.configVolume" . | nindent 10 }}
  128. - name: runtime-config
  129. {{- include "tempo.runtimeVolume" . | nindent 10 }}
  130. {{- if .Values.enterprise.enabled }}
  131. - name: license
  132. secret:
  133. secretName: {{ tpl .Values.license.secretName . }}
  134. {{- end }}
  135. {{- with .Values.ingester.extraVolumes }}
  136. {{- toYaml . | nindent 8 }}
  137. {{- end }}
  138. {{- if not .Values.ingester.persistence.enabled }}
  139. - name: data
  140. emptyDir: {}
  141. {{- else if .Values.ingester.persistence.inMemory }}
  142. - name: data
  143. {{- if .Values.ingester.persistence.inMemory }}
  144. emptyDir:
  145. medium: Memory
  146. {{- end }}
  147. {{- if .Values.ingester.persistence.size }}
  148. sizeLimit: {{ .Values.ingester.persistence.size }}
  149. {{- end }}
  150. {{- else }}
  151. volumeClaimTemplates:
  152. - metadata:
  153. {{- with .Values.ingester.persistence.annotations }}
  154. annotations:
  155. {{- toYaml . | nindent 10 }}
  156. {{- end }}
  157. name: data
  158. spec:
  159. accessModes:
  160. - ReadWriteOnce
  161. {{- with .Values.ingester.persistence.storageClass }}
  162. storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }}
  163. {{- end }}
  164. resources:
  165. requests:
  166. storage: {{ .Values.ingester.persistence.size | quote }}
  167. {{- end }}