deployment-gateway.yaml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {{- if .Values.gateway.enabled }}
  2. {{ $dict := dict "ctx" . "component" "gateway" }}
  3. apiVersion: apps/v1
  4. kind: Deployment
  5. metadata:
  6. name: {{ include "tempo.resourceName" $dict }}
  7. namespace: {{ .Release.Namespace }}
  8. labels:
  9. {{- include "tempo.labels" $dict | nindent 4 }}
  10. spec:
  11. minReadySeconds: 10
  12. {{- if not .Values.gateway.autoscaling.enabled }}
  13. replicas: {{ .Values.gateway.replicas }}
  14. {{- end }}
  15. revisionHistoryLimit: 10
  16. selector:
  17. matchLabels:
  18. {{- include "tempo.selectorLabels" $dict | nindent 6 }}
  19. template:
  20. metadata:
  21. annotations:
  22. checksum/config: {{ include (print .Template.BasePath "/gateway/configmap-gateway.yaml") . | sha256sum }}
  23. {{- with .Values.tempo.podAnnotations }}
  24. {{- toYaml . | nindent 8 }}
  25. {{- end }}
  26. {{- with .Values.gateway.podAnnotations }}
  27. {{- toYaml . | nindent 8 }}
  28. {{- end }}
  29. labels:
  30. {{- include "tempo.selectorLabels" $dict | nindent 8 }}
  31. {{- with .Values.tempo.podLabels }}
  32. {{- toYaml . | nindent 8 }}
  33. {{- end }}
  34. {{- with .Values.gateway.podLabels }}
  35. {{- toYaml . | nindent 8 }}
  36. {{- end }}
  37. spec:
  38. {{- if or (.Values.gateway.priorityClassName) (.Values.global.priorityClassName) }}
  39. priorityClassName: {{ default .Values.gateway.priorityClassName .Values.global.priorityClassName }}
  40. {{- end }}
  41. serviceAccountName: {{ include "tempo.serviceAccountName" . }}
  42. {{- with .Values.tempo.podSecurityContext }}
  43. securityContext:
  44. {{- toYaml . | nindent 8 }}
  45. {{- end }}
  46. terminationGracePeriodSeconds: {{ .Values.gateway.terminationGracePeriodSeconds }}
  47. enableServiceLinks: false
  48. {{- include "tempo.gatewayImagePullSecrets" . | nindent 6 -}}
  49. {{- with .Values.gateway.hostAliases }}
  50. hostAliases:
  51. {{- toYaml . | nindent 8 }}
  52. {{- end }}
  53. containers:
  54. - name: nginx
  55. image: "{{ include "tempo.imageReference" $dict }}"
  56. imagePullPolicy: {{ .Values.gateway.image.pullPolicy }}
  57. ports:
  58. - name: http-metrics
  59. containerPort: 8080
  60. protocol: TCP
  61. {{- with .Values.gateway.extraEnv }}
  62. env:
  63. {{- toYaml . | nindent 12 }}
  64. {{- end }}
  65. {{- with .Values.gateway.extraEnvFrom }}
  66. envFrom:
  67. {{- toYaml . | nindent 12 }}
  68. {{- end }}
  69. readinessProbe:
  70. {{- toYaml .Values.gateway.readinessProbe | nindent 12 }}
  71. volumeMounts:
  72. - name: config
  73. mountPath: /etc/nginx
  74. {{- if .Values.enterprise.enabled }}
  75. - name: license
  76. mountPath: /license
  77. {{- end }}
  78. {{- if .Values.gateway.basicAuth.enabled }}
  79. - name: auth
  80. mountPath: /etc/nginx/secrets
  81. {{- end }}
  82. - name: tmp
  83. mountPath: /tmp
  84. - name: docker-entrypoint-d-override
  85. mountPath: /docker-entrypoint.d
  86. {{- if .Values.gateway.extraVolumeMounts }}
  87. {{- toYaml .Values.gateway.extraVolumeMounts | nindent 12 }}
  88. {{- end }}
  89. resources:
  90. {{- toYaml .Values.gateway.resources | nindent 12 }}
  91. {{- with .Values.tempo.securityContext }}
  92. securityContext:
  93. {{- toYaml . | nindent 12 }}
  94. {{- end }}
  95. {{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
  96. {{- with .Values.gateway.topologySpreadConstraints }}
  97. topologySpreadConstraints:
  98. {{- tpl . $ | nindent 8 }}
  99. {{- end }}
  100. {{- end }}
  101. {{- with .Values.gateway.affinity }}
  102. affinity:
  103. {{- tpl . $ | nindent 8 }}
  104. {{- end }}
  105. {{- with .Values.gateway.nodeSelector }}
  106. nodeSelector:
  107. {{- toYaml . | nindent 8 }}
  108. {{- end }}
  109. {{- with .Values.gateway.tolerations }}
  110. tolerations:
  111. {{- toYaml . | nindent 8 }}
  112. {{- end }}
  113. volumes:
  114. - name: config
  115. configMap:
  116. name: {{ include "tempo.resourceName" (dict "ctx" . "component" "gateway") }}
  117. {{- if .Values.enterprise.enabled -}}
  118. - name: license
  119. secret:
  120. secretName: {{ tpl .Values.license.secretName . }}
  121. {{- end }}
  122. {{- if .Values.gateway.basicAuth.enabled }}
  123. - name: auth
  124. secret:
  125. secretName: {{ include "tempo.gatewayAuthSecret" . }}
  126. {{- end }}
  127. - name: tmp
  128. emptyDir: {}
  129. - name: docker-entrypoint-d-override
  130. emptyDir: {}
  131. {{- if .Values.gateway.extraVolumes }}
  132. {{- toYaml .Values.gateway.extraVolumes | nindent 8 }}
  133. {{- end }}
  134. {{- end }}