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.

91 lines
2.9 KiB

6 years ago
6 years ago
6 years ago
  1. {{- $name := include "marketing-api.fullname" . -}}
  2. {{- $cfgname := printf "%s-%s" "cfg" $name -}}
  3. apiVersion: apps/v1beta2
  4. kind: Deployment
  5. metadata:
  6. name: {{ template "marketing-api.fullname" . }}
  7. labels:
  8. ufo: {{ $cfgname}}
  9. app: {{ template "marketing-api.name" . }}
  10. chart: {{ template "marketing-api.chart" . }}
  11. release: {{ .Release.Name }}
  12. heritage: {{ .Release.Service }}
  13. spec:
  14. replicas: {{ .Values.replicaCount }}
  15. selector:
  16. matchLabels:
  17. app: {{ template "marketing-api.name" . }}
  18. release: {{ .Release.Name }}
  19. template:
  20. metadata:
  21. labels:
  22. app: {{ template "marketing-api.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. port: {{ .Values.probes.liveness.port }}
  36. path: {{ .Values.probes.liveness.path }}
  37. initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
  38. periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
  39. {{- end -}}
  40. {{- end -}}
  41. {{- if .Values.probes -}}
  42. {{- if .Values.probes.readiness }}
  43. readinessProbe:
  44. httpGet:
  45. port: {{ .Values.probes.readiness.port }}
  46. path: {{ .Values.probes.readiness.path }}
  47. initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
  48. periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
  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 }}