apiVersion: apps/v1
kind: Deployment
metadata:
  name: redmine
  labels:
    app: redmine
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redmine
  template:
    metadata:
      labels:
        app: redmine
    spec:
      containers:
        - name: redmine
          image: redmine:4.1.1
          ports:
            - containerPort: 3000
          env:
            - name: REDMINE_DB_POSTGRES
              value: database
            - name: REDMINE_DB_DATABASE 
              value: testdatabase
            - name: REDMINE_DB_USERNAME
              valueFrom:
                secretKeyRef:
                  name: postgres-secret
                  key: username
            - name: REDMINE_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgres-secret
                  key: password