apiVersion: apps/v1
kind: Deployment
metadata:
  name: server-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      component: server
  template:
    metadata:
      labels:
        component: server
    spec:
      containers:
        - name: server
          image: agamblin/eh-server
          ports:
            - containerPort: 5000
          env:
            - name: PORT_API
              value: '5000'
            - name: NODE_ENV
              value: production
            - name: SQL_HOST
              valueFrom:
                secretKeyRef:
                  name: eh-secrets
                  key: SQL_HOST
            - name: SQL_USER
              valueFrom:
                secretKeyRef:
                  name: eh-secrets
                  key: SQL_USER
            - name: SQL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: eh-secrets
                  key: SQL_PASSWORD
            - name: SQL_DB
              valueFrom:
                secretKeyRef:
                  name: eh-secrets
                  key: SQL_DB
            - name: SQL_PORT
              value: '3306'
            - name: JWT_SECRET
              valueFrom:
                secretKeyRef:
                  name: eh-secrets
                  key: JWT_SECRET
            - name: SEQUELIZE_LOGS
              value: 'false'
            - name: BO_ADMIN_PWD
              valueFrom:
                secretKeyRef:
                  name: eh-secrets
                  key: BO_ADMIN_PWD
            - name: LOGGER
              value: 'true'
            - name: AWS_BUCKET_NAME
              value: esport-hatcher
            - name: AWS_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  name: eh-secrets
                  key: AWS_ACCESS_KEY
            - name: AWS_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: eh-secrets
                  key: AWS_SECRET_KEY
