apiVersion: apps/v1
kind: Deployment
metadata:
  name: authelia
  namespace: authelia
  labels:
    app: authelia
spec:
  replicas: 1
  selector:
    matchLabels:
      app: authelia
  template:
    metadata:
      labels:
        app: authelia
    spec:
      enableServiceLinks: false
      volumes:
        - name: config-volume
          configMap:
            name: authelia-config-map
        - name: user-volume
          configMap:
            name: authelia-user-config-map
        - name: database-volume
          emptyDir:
            { }
      containers:
        - name: authelia
          image: authelia/authelia:4.35.6
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          env:
            - name: AUTHELIA_JWT_SECRET
              valueFrom:
                secretKeyRef:
                  name: authelia-secret
                  key: jwt_secret
            - name: AUTHELIA_NOTIFIER_SMTP_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: authelia-secret
                  key: notifier_smtp_password
            - name: AUTHELIA_STORAGE_ENCRYPTION_KEY
              valueFrom:
                secretKeyRef:
                  name: authelia-secret
                  key: storage.encryption_key
          volumeMounts:
            - name: config-volume
              mountPath: /config/configuration.yml
              subPath: config
            - name: user-volume
              mountPath: /config/users_database.yaml
              subPath: user
            - name: database-volume
              mountPath: /config/database