apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend-ui
  labels:
    app: frontend-ui
    type: frontend
    core.airy.co/managed: "true"
    core.airy.co/mandatory: "{{ .Values.mandatory }}"
    core.airy.co/component: "{{ .Values.component }}"
  annotations:
    core.airy.co/config-items-mandatory: "API_HOST"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontend-ui
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: frontend-ui
    spec:
      containers:
      - name: app
        image: "{{ .Values.global.containerRegistry}}/{{ .Values.image }}:{{ default .Chart.Version .Values.global.appImageTag }}"
        imagePullPolicy: Always
        env:
        - name: API_HOST
          valueFrom:
            configMapKeyRef:
              name: core-config
              key: API_HOST
        livenessProbe:
          httpGet:
            path: /health
            port: 80
            httpHeaders:
            - name: Health-Check
              value: health-check
          initialDelaySeconds: 30
          periodSeconds: 10
          failureThreshold: 3
      volumes:
        - name: provisioning-scripts
          configMap:
            name: provisioning-scripts
