apiVersion: apps/v1
kind: Deployment
metadata:
  name: sld-dashboard
  labels:
    name: sld-dashboard
spec:
  replicas: 1 
  selector:
    matchLabels:
      name: sld-dashboard
  template:
    metadata:
      labels:
        name: sld-dashboard
    spec:
      subdomain: primary
      containers:
        - name: sld-dashboard
          image: d10s0vsky/sld-dashboard:latest
          resources:
            limits:
              memory: 600Mi
              cpu: 1
            requests:
              memory: 300Mi
              cpu: 500m
          env:
          - name: DEBUG
            value: "True"
          - name: SECRET_KEY
            valueFrom:
              secretKeyRef:
                name: dashboard
                key: secret_key
          - name: DB_ENGINE
            value: "mysql"
          - name: DB_NAME
            value: "restapi"
          - name: DB_HOST
            value: "db"
          - name: DB_NAME
            value: "restapi"
          - name: DB_PORT
            value: "3306"
          - name: DB_USERNAME
            value: "root"
          - name: DB_PASS
            valueFrom:
              secretKeyRef:
                name: db
                key: password
          imagePullPolicy: Always
          command: ["gunicorn", "--config", "gunicorn-cfg.py", "run:app"]
          ports:
            - containerPort: 5000
