apiVersion: apps/v1
kind: Deployment
metadata:
  name: firefly
  labels:
    app: firefly
spec:
  selector:
    matchLabels:
      app: firefly
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: firefly
    spec:
      containers:
      - image: registry.homelab.dsb.dev/jc5x/firefly-iii:version-5.4.6
        imagePullPolicy: IfNotPresent
        name: firefly
        env:
        - name: APP_KEY
          valueFrom:
            secretKeyRef:
              key: firefly.app.key
              name: firefly
        - name: DB_HOST
          value: postgres.storage.svc.cluster.local
        - name: DB_PORT
          value: '5432'
        - name: DB_CONNECTION
          value: pgsql
        - name: DB_DATABASE
          valueFrom:
            secretKeyRef:
              key: firefly.database.name
              name: firefly
        - name: DB_USERNAME
          valueFrom:
            secretKeyRef:
              key: postgres.user
              name: postgres
        - name: DB_PASSWORD
          valueFrom:
            secretKeyRef:
              key: postgres.password
              name: postgres
        readinessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 5
        resources:
          limits:
            memory: 512Mi
