You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
3.1 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. {{- $name := include "ordering-backgroundtasks.fullname" . -}}
  2. {{- $cfgname := printf "cfg-%s" $name | trunc 63 }}
  3. apiVersion: apps/v1
  4. kind: Deployment
  5. metadata:
  6. name: {{ template "ordering-backgroundtasks.fullname" . }}
  7. labels:
  8. app: {{ template "ordering-backgroundtasks.name" . }}
  9. chart: {{ template "ordering-backgroundtasks.chart" . }}
  10. release: {{ .Release.Name }}
  11. heritage: {{ .Release.Service }}
  12. spec:
  13. replicas: {{ .Values.replicaCount }}
  14. selector:
  15. matchLabels:
  16. app: {{ template "ordering-backgroundtasks.name" . }}
  17. release: {{ .Release.Name }}
  18. template:
  19. metadata:
  20. labels:
  21. app: {{ template "ordering-backgroundtasks.name" . }}
  22. release: {{ .Release.Name }}
  23. spec:
  24. {{ if .Values.inf.registry -}}
  25. imagePullSecrets:
  26. - name: {{ .Values.inf.registry.secretName }}
  27. {{- end }}
  28. containers:
  29. - name: {{ .Chart.Name }}
  30. {{ if .Values.probes -}}
  31. {{- if .Values.probes.liveness -}}
  32. livenessProbe:
  33. httpGet:
  34. port: {{ .Values.probes.liveness.port }}
  35. path: {{ .Values.probes.liveness.path }}
  36. initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
  37. periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
  38. {{- end -}}
  39. {{- end -}}
  40. {{- if .Values.probes -}}
  41. {{- if .Values.probes.readiness }}
  42. readinessProbe:
  43. httpGet:
  44. port: {{ .Values.probes.readiness.port }}
  45. path: {{ .Values.probes.readiness.path }}
  46. initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
  47. periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
  48. timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
  49. {{- end -}}
  50. {{- end }}
  51. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  52. imagePullPolicy: {{ .Values.image.pullPolicy }}
  53. env:
  54. - name: PATH_BASE
  55. value: {{ include "pathBase" . }}
  56. - name: k8sname
  57. value: {{ .Values.clusterName }}
  58. {{- if .Values.env.values -}}
  59. {{- range .Values.env.values }}
  60. - name: {{ .name }}
  61. value: {{ .value | quote }}
  62. {{- end -}}
  63. {{- end -}}
  64. {{- if .Values.env.configmap -}}
  65. {{- range .Values.env.configmap }}
  66. - name: {{ .name }}
  67. valueFrom:
  68. configMapKeyRef:
  69. name: {{ $cfgname }}
  70. key: {{ .key }}
  71. {{- end -}}
  72. {{- end }}
  73. ports:
  74. - name: http
  75. containerPort: 80
  76. protocol: TCP
  77. resources:
  78. {{ toYaml .Values.resources | indent 12 }}
  79. {{- with .Values.nodeSelector }}
  80. nodeSelector:
  81. {{ toYaml . | indent 8 }}
  82. {{- end }}
  83. {{- with .Values.affinity }}
  84. affinity:
  85. {{ toYaml . | indent 8 }}
  86. {{- end }}
  87. {{- with .Values.tolerations }}
  88. tolerations:
  89. {{ toYaml . | indent 8 }}
  90. {{- end }}