kind: Deployment
apiVersion: apps/v1
metadata:
  name: quality-backend-dashboard
  namespace: quality-dashboard
  labels:
    app: quality-dashboard
    app.kubernetes.io/component: quality-backend
    app.kubernetes.io/instance: quality-dashboard
    app.kubernetes.io/name: quality-dashboard
    component: quality-backend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: quality-dashboard
      component: quality-backend
  template:
    metadata:
      labels:
        app: quality-dashboard
        app.kubernetes.io/component: quality-backend
        app.kubernetes.io/instance: quality-dashboard
        app.kubernetes.io/name: quality-dashboard
        component: quality-backend
    spec:
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      containers:
        - resources:
            limits:
              cpu: 500m
              memory: 256Mi
            requests:
              cpu: 100m
              memory: 32Mi
          name: quality-backend-dashboard
          command: ["/root/qe-dashboard-backend"]
          env:
            - name: MODE_SSL
              value: "disable"
            - name: MAX_CONNECTIONS
              value: "100"
            - name: POSTGRES_ENT_HOST
              valueFrom:
                secretKeyRef:
                  name: quality-dashboard-secrets
                  key: rds-endpoint
            - name: POSTGRES_ENT_DATABASE
              valueFrom:
                secretKeyRef:
                  name: quality-dashboard-secrets
                  key: POSTGRESQL_DATABASE
            - name: POSTGRES_ENT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: quality-dashboard-secrets
                  key: POSTGRES_PASSWORD
            - name: POSTGRES_ENT_USER
              valueFrom:
                secretKeyRef:
                  name: quality-dashboard-secrets
                  key: POSTGRES_USER
            - name: GITHUB_TOKEN
              valueFrom:
                secretKeyRef:
                  name: quality-dashboard-secrets
                  key: github-token
          args:
            - "--port=8080"
          securityContext:
            capabilities:
              drop:
                - ALL
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
          imagePullPolicy: Always
          image: >-
            quay.io/redhat-appstudio/quality-dashboard-backend:latest

