{{- if .Values.web.enabled }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "api7ee.fullname" . }}-web labels: {{- include "api7ee.labels" . | nindent 4 }} app.kubernetes.io/component: web spec: {{- if not .Values.web.autoscaling.enabled }} replicas: {{ .Values.web.replicaCount }} {{- end }} selector: matchLabels: {{- include "api7ee.selectorLabels" . | nindent 6 }} app.kubernetes.io/component: web template: metadata: annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} labels: {{- include "api7ee.selectorLabels" . | nindent 8 }} app.kubernetes.io/component: web spec: {{- with .Values.global.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "api7ee.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: web securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.global.imageRegistry | default .Values.web.image.registry }}/{{ .Values.web.image.repository }}:{{ .Values.web.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.web.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.web.service.targetPort }} protocol: TCP livenessProbe: {{- toYaml .Values.web.livenessProbe | nindent 12 }} readinessProbe: {{- toYaml .Values.web.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.web.resources | nindent 12 }} env: - name: PORT value: "{{ .Values.web.service.targetPort }}" {{- with .Values.web.env }} {{- toYaml . | nindent 12 }} {{- end }} {{- if .Values.configMap.data }} envFrom: - configMapRef: name: {{ include "api7ee.fullname" . }} {{- end }} volumeMounts: - name: tmp mountPath: /tmp volumes: - name: tmp emptyDir: {} {{- with .Values.web.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.web.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.web.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- end }}