{{ if .Values.front.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: front
spec:
  replicas: 1
  selector:
    matchLabels:
      app: front
  template:
    metadata:
      name: front
      labels:
        app: front
    spec:
      containers:
      - name: front
        image: docker.io/goalprofit/front:{{.Values.front.version}}
        imagePullPolicy: Always
        volumeMounts:
        - mountPath: /work
          name: work
          subPath: data/static/

        env:
{{ if .Values.local_user_id }}
        - name: LOCAL_USER_ID
          value: "{{.Values.local_user_id}}"
{{ end }}
{{ if .Values.local_user_name }}
        - name: LOCAL_USER_NAME
          value: "{{.Values.local_user_name}}"
{{ end }}
      imagePullSecrets:
      - name: regcred

      volumes:
      - name: work
        {{ include "app.customer_volume" . | nindent 8}}

      {{ include "app.affinity" . | nindent 6}}
{{ end }}