apiVersion: apps/v1
kind: Deployment
metadata:
  name: homebridge
  namespace: homebridge
  labels:
    app: homebridge
spec:
  replicas: 1
  selector:
    matchLabels:
      app: homebridge
  template:
    metadata:
      labels:
        app: homebridge
      name: homebridge
    spec:
      # securityContext:
      #   runAsUser: 1000
      #   fsGroup: 1000
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      containers:
      - name: homebridge
        image: oznu/homebridge:latest
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 18581
          name: homebridge-port
        - containerPort: 53055
          name: homebridge-srv
        env:
        - name: tz
          value: 'Europe/Rome'
        # You can change these to ID values to 1000 (ubuntu user) if not using Bluetooth
        # - name: PUID
        #   value: '0'
        # - name: PGID
        #   value: '0'
        - name: HOMEBRIDGE_CONFIG_UI
          value: '1'
        - name: HOMEBRIDGE_CONFIG_UI_PORT
          value: '18581'
        volumeMounts:
        - name: homebridge
          mountPath: /homebridge
          subPath: _homebridge
          readOnly: false
      volumes:
      - name: homebridge
        persistentVolumeClaim:
          claimName: homebridge-data-pvc