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
        ports:
        - containerPort: 3000
        env:
        - name: REDMINE_PASSWORD
          value: redmine
        - name: REDMINE_USER
          value: redmine
        - name: REDMINE_DB_USERNAME
          value: redmine
        - name: REDMINE_DB_PASSWORD
          value: redmine
        - name: REDMINE_DB_MYSQL
          value: mariadb-service
        - name: REDMINE_DB_PORT_NUMBER
          value: "3306"
---
apiVersion: v1
kind: Service
metadata:
  name: redmine
spec:
  ports:
  - name: port-0
    nodePort: 32200
    port: 3000
  selector:
    app: redmine
  type: NodePort
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: redmine-tls-alldcs
spec:
  entryPoints:
    - websecure
  routes:
  - match: Host(`redmine.alldcs.nl`)
    kind: Rule
    services:
    - name: redmine
      port: 3000
  tls:
    certResolver: letsencrypt
