apiVersion: apps/v1
kind: Deployment
metadata:
  name: dashboard
  namespace: "{{namespace}}"
spec:
  selector:
    matchLabels:
      app: dashboard
  replicas: 1
  template:
    metadata:
      labels:
        app: dashboard
    spec:
      containers:
      - name: dashboard
        image: oxyl/dashboard:{{tag}}
        imagePullPolicy: Always
        env:
          - name: NODE_ENV
            valueFrom:
              configMapKeyRef:
                name: config
                key: environment
          - name: BOT_ID
            valueFrom:
              configMapKeyRef:
                name: config
                key: clientID
          - name: DASHBOARD_URL
            valueFrom:
              configMapKeyRef:
                name: config
                key: dashboardURL
          - name: SECRET
            valueFrom: 
              secretKeyRef:
                name: discord
                key: secret
          - name: REDIS_OAUTH2_DATABASE
            value: "2"
          - name: REDIS_RATELIMIT_DATABASE
            value: "3"
        ports:
        - containerPort: 8502
          name: http