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.

73 lines
2.1 KiB

  1. {{- $name := include "catalog-api.fullname" . -}}
  2. {{- $cfgname := printf "%s-%s" "cfg" $name -}}
  3. apiVersion: apps/v1beta2
  4. kind: Deployment
  5. metadata:
  6. name: {{ template "catalog-api.fullname" . }}
  7. labels:
  8. ufo: {{ $cfgname}}
  9. app: {{ template "catalog-api.name" . }}
  10. chart: {{ template "catalog-api.chart" . }}
  11. release: {{ .Release.Name }}
  12. heritage: {{ .Release.Service }}
  13. spec:
  14. replicas: {{ .Values.replicaCount }}
  15. selector:
  16. matchLabels:
  17. app: {{ template "catalog-api.name" . }}
  18. release: {{ .Release.Name }}
  19. template:
  20. metadata:
  21. labels:
  22. app: {{ template "catalog-api.name" . }}
  23. release: {{ .Release.Name }}
  24. spec:
  25. {{ if .Values.imagePullSecrets -}}
  26. imagePullSecrets:
  27. {{ range .Values.imagePullSecrets -}}
  28. - name: {{ .name }}
  29. {{- end -}}
  30. {{- end }}
  31. containers:
  32. - name: {{ .Chart.Name }}
  33. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  34. imagePullPolicy: {{ .Values.image.pullPolicy }}
  35. env:
  36. - name: PATH_BASE
  37. value: {{ include "pathBase" . }}
  38. - name: k8sname
  39. value: {{ .Values.clusterName }}
  40. {{- if .Values.env.values -}}
  41. {{- range .Values.env.values }}
  42. - name: {{ .name }}
  43. value: {{ .value | quote }}
  44. {{- end -}}
  45. {{- end -}}
  46. {{- if .Values.env.configmap -}}
  47. {{- range .Values.env.configmap }}
  48. - name: {{ .name }}
  49. valueFrom:
  50. configMapKeyRef:
  51. name: {{ $cfgname }}
  52. key: {{ .key }}
  53. {{- end -}}
  54. {{- end }}
  55. ports:
  56. - name: http
  57. containerPort: 80
  58. protocol: TCP
  59. resources:
  60. {{ toYaml .Values.resources | indent 12 }}
  61. {{- with .Values.nodeSelector }}
  62. nodeSelector:
  63. {{ toYaml . | indent 8 }}
  64. {{- end }}
  65. {{- with .Values.affinity }}
  66. affinity:
  67. {{ toYaml . | indent 8 }}
  68. {{- end }}
  69. {{- with .Values.tolerations }}
  70. tolerations:
  71. {{ toYaml . | indent 8 }}
  72. {{- end }}