---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: eve-warehouse-app-v1
  labels:
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      version: v1
  template:
    metadata:
      labels:
        version: v1
    spec:
      serviceAccountName: eve-warehouse-app
      containers:
        - name: app
          image: eve-app-image
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 8080
          livenessProbe:
            httpGet:
              path: /health-check
              port: http
          readinessProbe:
            httpGet:
              path: /health-check
              port: http
          env:
            - name: AUTH0_DOMAIN
              valueFrom:
                secretKeyRef:
                  name: eve-warehouse-app-secret
                  key: AUTH0_DOMAIN
            - name: AUTH0_AUDIENCE
              valueFrom:
                secretKeyRef:
                  name: eve-warehouse-app-secret
                  key: AUTH0_AUDIENCE
            - name: AUTH0_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  name: eve-warehouse-app-secret
                  key: AUTH0_CLIENT_ID
            - name: AUTH0_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: eve-warehouse-app-secret
                  key: AUTH0_CLIENT_SECRET
            - name: EVE_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  name: eve-warehouse-app-secret
                  key: EVE_CLIENT_ID
            - name: EVE_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: eve-warehouse-app-secret
                  key: EVE_CLIENT_SECRET
            - name: COOKIE_SECRET
              valueFrom:
                secretKeyRef:
                  name: eve-warehouse-app-secret
                  key: COOKIE_SECRET
            - name: EVE_LOGIN_URL
              value: 'https://login.eveonline.com'
            - name: EVE_LOGIN_URL
              value: 'https://login.eveonline.com'
