kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: unifi-ctrl
spec:
  serviceName: "unifi"
  replicas: 1
  selector:
    matchLabels:
      name: unifi-ctrl
  template:
    metadata:
      name: unifi-ctrl
      labels:
        name: unifi-ctrl
    spec:
      containers:
        - name: unifi-ctrl
          image: 'docker.io/jacobalberty/unifi:v6.2'
          ports:
            - containerPort: 3478
              protocol: UDP
            - containerPort: 8080
              protocol: TCP
            - containerPort: 8443
              protocol: TCP
            - containerPort: 8843
              protocol: TCP
            - containerPort: 8880
              protocol: TCP
            - containerPort: 6789
              protocol: TCP
          volumeMounts:
            - name: unifi-ctrl
              mountPath: /unifi
              subPath: unifi
  volumeClaimTemplates:
  - metadata:
      name: unifi-ctrl
    spec:
      storageClassName: "nfs-storageclass"
      accessModes: ["ReadWriteOnce"]
      resources:
        requests:
          storage: 10Gi
