deployment-table-manager.yaml 4.6 KB

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