---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: lighthouse
  namespace: default
spec:
  serviceName: "lighthouse"
  replicas: 1 # CAUTION: Only one lighthouse at most should be running at any time in the cluster
  selector:
    matchLabels:
      app: lighthouse
  template:
    metadata:
      labels:
        app: lighthouse
    spec:
      containers:
      - name: lighthouse
        image: phoesion/phoesion.glow.lighthouse:0.0.296-debian
        ports:
        - containerPort: 15000
          name: lighthouse
        env:
        - name: LIGHTHOUSE_DataPath
          value: "/data/lighthouse"
        - name: LIGHTHOUSE_KaleidoscopeConnectionString
          value: "Host=kaleidoscope-headless"
        - name: LIGHTHOUSE_EntityAuthKey
          value: "" #CONFIG: Add lighthouse auth key here
        - name: LIGHTHOUSE_DefaultUser__Username
          value: "" #CONFIG: Add username for default user (it will be automatically created)
        - name: LIGHTHOUSE_DefaultUser__Name
          value: "" #CONFIG: Add name for default user
        - name: LIGHTHOUSE_DefaultUser__Description
          value: "Default administrator account created from configs"
        - name: LIGHTHOUSE_DefaultUser__Email
          value: "" #CONFIG: Add email for default user
        - name: LIGHTHOUSE_DefaultUser__SshKey
          value: "" #CONFIG: Add public ssh key for default user
        volumeMounts:
        - name: lighthouse-volume
          mountPath: /data/lighthouse
  # CAUTION: use the commented 'volumeClaimTemplates' section before for persistent storage
      volumes:
        - name: lighthouse-volume
          emptyDir: {}
  #volumeClaimTemplates:
  #- metadata:
  #    name: lighthouse-volume
  #  spec:
  #    accessModes: [ "ReadWriteOnce" ]
  #    storageClassName: custom-retain
  #    resources:
  #      requests:
  #        storage: 32Gi