apiVersion: apps/v1
kind: Deployment
metadata:
  name: crimson
spec:
  replicas: 1
  selector:
    matchLabels:
      app: crimson
  template:
    metadata:
      labels:
        app: crimson
    spec:
      containers:
        - name: app
          image: localhost:32000/crimson:latest
          env:
            - name: TOKEN
              valueFrom:
                secretKeyRef:
                  name: discord-secrets
                  key: token
            - name: DB_PASS
              valueFrom:
                secretKeyRef:
                  name: db-credentials
                  key: dbPassword
            - name: REST_USER_NAME
              valueFrom:
                secretKeyRef:
                  name: crimson-credentials
                  key: userName
            - name: REST_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: crimson-credentials
                  key: password
            - name: DB_PORT
              valueFrom:
                configMapKeyRef:
                  name: db-config
                  key: port
            - name: DB_USER
              valueFrom:
                configMapKeyRef:
                  name: db-config
                  key: user
            - name: DB_NAME
              valueFrom:
                configMapKeyRef:
                  name: db-config
                  key: name
            - name: DB_HOST
              valueFrom:
                secretKeyRef:
                  name: db-credentials
                  key: dbHost
          imagePullPolicy: Always
          volumeMounts:
            - mountPath: /logs
              name: logs
      volumes:
        - name: logs
          hostPath:
            path: /opt/kubernetes/logs