apiVersion: apps/v1
kind: Deployment
metadata:
  name: dashboard
  namespace: dashboard
  labels:
    app.kubernetes.io/name: dashboard
    app.kubernetes.io/part-of: dashboard
spec:
  replicas: 1
  revisionHistoryLimit: 0
  selector:
    matchLabels:
        app.kubernetes.io/name: dashboard
        app.kubernetes.io/part-of: dashboard
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dashboard
        app.kubernetes.io/part-of: dashboard
    spec:
      nodeSelector:
        cloud.google.com/gke-nodepool: web-pool
      containers:
        - name: dashboard
          image: flrs/sd_covid_dashboard_dashboard
          env:
            - name: DB_HOST
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: db_host
            - name: DB_NAME
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: db_name
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: db_user
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: db_pass
          ports:
            - name: http
              containerPort: 8866
            - name: https
              containerPort: 8866