deployment-web.yaml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. {{- end }}
  25. {{- if or .Values.global.registry.createSecret .Values.global.imagePullSecrets }}
  26. imagePullSecrets:
  27. {{- if .Values.global.registry.createSecret }}
  28. - name: {{ include "shop-recycle.fullname" . }}-registry-secret
  29. {{- end }}
  30. {{- with .Values.global.imagePullSecrets }}
  31. {{ toYaml . | indent 8 }}
  32. {{- end }}
  33. {{- end }}
  34. {{- with .Values.tolerations }}
  35. tolerations:
  36. {{- toYaml . | nindent 8 }}
  37. {{- end }}
  38. containers:
  39. - name: web
  40. image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.webFrontend.image.name }}:{{ .Values.webFrontend.image.tag | default .Values.image.tag | default .Chart.AppVersion }}"
  41. imagePullPolicy: {{ .Values.image.pullPolicy }}
  42. ports:
  43. - name: http
  44. containerPort: {{ .Values.webFrontend.containerPort }}
  45. protocol: {{ .Values.webFrontend.protocol }}
  46. env:
  47. {{- range $key, $value := .Values.webFrontend.env }}
  48. - name: {{ $key }}
  49. value: "{{ $value }}"
  50. {{- end }}
  51. {{- if .Values.webFrontend.livenessProbe }}
  52. livenessProbe:
  53. {{- toYaml .Values.webFrontend.livenessProbe | nindent 12 }}
  54. {{- end }}
  55. {{- if .Values.webFrontend.readinessProbe }}
  56. readinessProbe:
  57. {{- toYaml .Values.webFrontend.readinessProbe | nindent 12 }}
  58. {{- end }}
  59. resources:
  60. {{- toYaml .Values.webFrontend.resources | nindent 12 }}
  61. {{- end }}