deployment-web.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {{- if .Values.webFrontend.enabled }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ include "shop-recycle.fullname" . }}-web
  6. labels:
  7. app: {{ include "shop-recycle.fullname" . }}-web
  8. {{- include "shop-recycle.labels" . | nindent 4 }}
  9. namespace: {{ .Release.Namespace }}
  10. spec:
  11. replicas: {{ .Values.webFrontend.replicaCount }}
  12. selector:
  13. matchLabels:
  14. app: {{ include "shop-recycle.fullname" . }}-web
  15. {{- include "shop-recycle.selectorLabels" . | nindent 6 }}
  16. template:
  17. metadata:
  18. labels:
  19. app: {{ include "shop-recycle.fullname" . }}-web
  20. {{- include "shop-recycle.selectorLabels" . | nindent 8 }}
  21. spec:
  22. {{- if .Values.rbac.create }}
  23. serviceAccountName: {{ include "shop-recycle.serviceAccountName" . }}
  24. imagePullSecrets:
  25. - name: shop-recycle-registry-secret
  26. {{- end }}
  27. {{- if or .Values.global.registry.createSecret .Values.global.imagePullSecrets }}
  28. imagePullSecrets:
  29. {{- if .Values.global.registry.createSecret }}
  30. - name: {{ include "shop-recycle.fullname" . }}-registry-secret
  31. {{- end }}
  32. {{- with .Values.global.imagePullSecrets }}
  33. {{ toYaml . | indent 8 }}
  34. {{- end }}
  35. {{- end }}
  36. {{- with .Values.tolerations }}
  37. tolerations:
  38. {{- toYaml . | nindent 8 }}
  39. {{- end }}
  40. containers:
  41. - name: web
  42. image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.webFrontend.image.name }}:{{ .Values.webFrontend.image.tag | default .Values.image.tag | default .Chart.AppVersion }}"
  43. imagePullPolicy: {{ .Values.image.pullPolicy }}
  44. ports:
  45. - name: http
  46. containerPort: {{ .Values.webFrontend.containerPort }}
  47. protocol: {{ .Values.webFrontend.protocol }}
  48. env:
  49. {{- range $key, $value := .Values.webFrontend.env }}
  50. - name: {{ $key }}
  51. value: "{{ $value }}"
  52. {{- end }}
  53. {{- if .Values.webFrontend.livenessProbe }}
  54. livenessProbe:
  55. {{- toYaml .Values.webFrontend.livenessProbe | nindent 12 }}
  56. {{- end }}
  57. {{- if .Values.webFrontend.readinessProbe }}
  58. readinessProbe:
  59. {{- toYaml .Values.webFrontend.readinessProbe | nindent 12 }}
  60. {{- end }}
  61. resources:
  62. {{- toYaml .Values.webFrontend.resources | nindent 12 }}
  63. {{- end }}