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.

89 lines
2.9 KiB

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