Nenhuma Descrição

frontend-dpl.yaml 9.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
  2. kind: Deployment
  3. metadata:
  4. name: {{ template "shuffle.frontend.name" . }}
  5. namespace: {{ include "common.names.namespace" . | quote }}
  6. labels: {{- include "shuffle.frontend.labels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  7. {{- if or .Values.frontend.deploymentAnnotations .Values.commonAnnotations }}
  8. {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.frontend.deploymentAnnotations .Values.commonAnnotations) "context" .) }}
  9. annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
  10. {{- end }}
  11. spec:
  12. {{- if not .Values.frontend.autoscaling.hpa.enabled }}
  13. replicas: {{ .Values.frontend.replicaCount }}
  14. {{- end }}
  15. {{- if .Values.frontend.updateStrategy }}
  16. strategy: {{- toYaml .Values.frontend.updateStrategy | nindent 4 }}
  17. {{- end }}
  18. {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.frontend.podLabels .Values.commonLabels) "context" .) }}
  19. selector:
  20. matchLabels: {{- include "shuffle.frontend.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
  21. template:
  22. metadata:
  23. {{- if .Values.frontend.podAnnotations }}
  24. annotations: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.podAnnotations "context" $) | nindent 8 }}
  25. {{- end }}
  26. labels: {{- include "shuffle.frontend.labels" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
  27. spec:
  28. {{- include "shuffle.frontend.imagePullSecrets" . | nindent 6 }}
  29. serviceAccountName: {{ template "shuffle.frontend.serviceAccount.name" . }}
  30. automountServiceAccountToken: {{ .Values.frontend.automountServiceAccountToken }}
  31. {{- if .Values.frontend.hostAliases }}
  32. hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.hostAliases "context" $) | nindent 8 }}
  33. {{- end }}
  34. {{- if .Values.frontend.affinity }}
  35. affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.frontend.affinity "context" $) | nindent 8 }}
  36. {{- else }}
  37. affinity:
  38. podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.frontend.podAffinityPreset "component" "frontend" "customLabels" $podLabels "context" $) | nindent 10 }}
  39. podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.frontend.podAntiAffinityPreset "component" "frontend" "customLabels" $podLabels "context" $) | nindent 10 }}
  40. nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.frontend.nodeAffinityPreset.type "key" .Values.frontend.nodeAffinityPreset.key "values" .Values.frontend.nodeAffinityPreset.values) | nindent 10 }}
  41. {{- end }}
  42. {{- if .Values.frontend.nodeSelector }}
  43. nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.frontend.nodeSelector "context" $) | nindent 8 }}
  44. {{- end }}
  45. {{- if .Values.frontend.tolerations }}
  46. tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.tolerations "context" .) | nindent 8 }}
  47. {{- end }}
  48. {{- if .Values.frontend.priorityClassName }}
  49. priorityClassName: {{ .Values.frontend.priorityClassName | quote }}
  50. {{- end }}
  51. {{- if .Values.frontend.schedulerName }}
  52. schedulerName: {{ .Values.frontend.schedulerName | quote }}
  53. {{- end }}
  54. {{- if .Values.frontend.topologySpreadConstraints }}
  55. topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.topologySpreadConstraints "context" .) | nindent 8 }}
  56. {{- end }}
  57. {{- if .Values.frontend.podSecurityContext.enabled }}
  58. securityContext: {{- omit .Values.frontend.podSecurityContext "enabled" | toYaml | nindent 8 }}
  59. {{- end }}
  60. {{- if .Values.frontend.terminationGracePeriodSeconds }}
  61. terminationGracePeriodSeconds: {{ .Values.frontend.terminationGracePeriodSeconds }}
  62. {{- end }}
  63. initContainers:
  64. {{- if .Values.frontend.initContainers }}
  65. {{- include "common.tplvalues.render" (dict "value" .Values.frontend.initContainers "context" $) | nindent 8 }}
  66. {{- end }}
  67. containers:
  68. - name: frontend
  69. image: {{ template "shuffle.frontend.image" . }}
  70. imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
  71. {{- if .Values.frontend.containerSecurityContext.enabled }}
  72. securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.frontend.containerSecurityContext "context" $) | nindent 12 }}
  73. {{- end }}
  74. {{- if .Values.diagnosticMode.enabled }}
  75. command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
  76. {{- else if .Values.frontend.command }}
  77. command: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.command "context" $) | nindent 12 }}
  78. {{- end }}
  79. {{- if .Values.diagnosticMode.enabled }}
  80. args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
  81. {{- else if .Values.frontend.args }}
  82. args: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.args "context" $) | nindent 12 }}
  83. {{- end }}
  84. env:
  85. {{- if .Values.frontend.extraEnvVars }}
  86. {{- include "common.tplvalues.render" (dict "value" .Values.frontend.extraEnvVars "context" $) | nindent 12 }}
  87. {{- end }}
  88. envFrom:
  89. - configMapRef:
  90. name: {{ include "shuffle.frontend.name" . }}-env
  91. {{- if .Values.frontend.extraEnvVarsCM }}
  92. - configMapRef:
  93. name: {{ include "common.tplvalues.render" (dict "value" .Values.frontend.extraEnvVarsCM "context" $) }}
  94. {{- end }}
  95. {{- if .Values.frontend.extraEnvVarsSecret }}
  96. - secretRef:
  97. name: {{ include "common.tplvalues.render" (dict "value" .Values.frontend.extraEnvVarsSecret "context" $) }}
  98. {{- end }}
  99. {{- if .Values.frontend.resources }}
  100. resources: {{- toYaml .Values.frontend.resources | nindent 12 }}
  101. {{- else if ne .Values.frontend.resourcesPreset "none" }}
  102. resources: {{- include "common.resources.preset" (dict "type" .Values.frontend.resourcesPreset) | nindent 12 }}
  103. {{- end }}
  104. ports:
  105. - name: http
  106. containerPort: {{ .Values.frontend.containerPorts.http }}
  107. {{- if .Values.frontend.containerPorts.https }}
  108. - name: https
  109. containerPort: {{ .Values.frontend.containerPorts.https }}
  110. {{- end }}
  111. {{- if .Values.frontend.extraContainerPorts }}
  112. {{- include "common.tplvalues.render" (dict "value" .Values.frontend.extraContainerPorts "context" $) | nindent 12 }}
  113. {{- end }}
  114. {{- if not .Values.diagnosticMode.enabled }}
  115. {{- if .Values.frontend.customLivenessProbe }}
  116. livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.customLivenessProbe "context" $) | nindent 12 }}
  117. {{- else if .Values.frontend.livenessProbe.enabled }}
  118. livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.frontend.livenessProbe "enabled") "context" $) | nindent 12 }}
  119. httpGet:
  120. path: /
  121. port: {{ .Values.frontend.containerPorts.http }}
  122. {{- end }}
  123. {{- if .Values.frontend.customReadinessProbe }}
  124. readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.customReadinessProbe "context" $) | nindent 12 }}
  125. {{- else if .Values.frontend.readinessProbe.enabled }}
  126. readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.frontend.readinessProbe "enabled") "context" $) | nindent 12 }}
  127. httpGet:
  128. path: /
  129. port: {{ .Values.frontend.containerPorts.http }}
  130. {{- end }}
  131. {{- if .Values.frontend.customStartupProbe }}
  132. startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.customStartupProbe "context" $) | nindent 12 }}
  133. {{- else if .Values.frontend.startupProbe.enabled }}
  134. startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.frontend.startupProbe "enabled") "context" $) | nindent 12 }}
  135. httpGet:
  136. path: /
  137. port: {{ .Values.frontend.containerPorts.http }}
  138. {{- end }}
  139. {{- end }}
  140. {{- if .Values.frontend.lifecycleHooks }}
  141. lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.lifecycleHooks "context" $) | nindent 12 }}
  142. {{- end }}
  143. volumeMounts:
  144. - name: empty-dir
  145. mountPath: /tmp
  146. subPath: tmp-dir
  147. {{- if .Values.frontend.extraVolumeMounts }}
  148. {{- include "common.tplvalues.render" (dict "value" .Values.frontend.extraVolumeMounts "context" $) | nindent 12 }}
  149. {{- end }}
  150. {{- if .Values.frontend.sidecars }}
  151. {{- include "common.tplvalues.render" ( dict "value" .Values.frontend.sidecars "context" $) | nindent 8 }}
  152. {{- end }}
  153. volumes:
  154. - name: empty-dir
  155. emptyDir: {}
  156. {{- if .Values.frontend.extraVolumes }}
  157. {{- include "common.tplvalues.render" (dict "value" .Values.frontend.extraVolumes "context" $) | nindent 8 }}
  158. {{- end }}