#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#

image:
  # -- image repository
  repository: homeassistant/home-assistant
  # -- image tag
  tag: "2023.3"
  # -- image pull policy
  pullPolicy: IfNotPresent

# -- environment variables.
# @default -- See below
env:
  # -- Set the container timezone
  TZ: Europe/Berlin

# -- Configures service settings for the chart. Normally this does not need to be modified.
# @default -- See values.yaml
service:
  main:
    ports:
      http:
        port: 8123

ingress:
  # -- Enable and configure ingress settings for the chart under this key.
  # @default -- See values.yaml
  main:
    enabled: false

# -- Enable devices to be discoverable
# hostNetwork: true

# -- When hostNetwork is true set dnsPolicy to ClusterFirstWithHostNet
# dnsPolicy: ClusterFirstWithHostNet

securityContext:
  # -- (bool) Privileged securityContext may be required if USB devics are accessed directly through the host machine
  privileged:  # true


resources:
  requests:
    cpu: "100m"
    memory: "200Mi"
  limits:
    cpu: "2"
    memory: "1Gi"

# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence:
  config:
    enabled: true
    existingClaim: homeassistant-nfs

  # -- Configure a hostPathMount to mount a USB device in the container.
  # @default -- See values.yaml
  usb:
    enabled: false
    type: hostPath
    hostPath: /path/to/device

# -- Enable and configure mariadb database subchart under this key.
#    For more options see [mariadb chart documentation](https://github.com/bitnami/charts/tree/master/bitnami/mariadb)
# @default -- See values.yaml
mariadb:
  enabled: false
  architecture: standalone
  auth:
    database: home-assistant
    username: home-assistant
    password: home-assistant-pass
    rootPassword: home-assistantrootpass
  primary:
    persistence:
      enabled: false
      # storageClass: ""

# -- Enable and configure postgresql database subchart under this key.
#    For more options see [postgresql chart documentation](https://github.com/bitnami/charts/tree/master/bitnami/postgresql)
# @default -- See values.yaml
postgresql:
  enabled: false
  image:
# -- Enable and configure influxdb database subchart under this key.
#    For more options see [influxdb chart documentation](https://github.com/bitnami/charts/tree/master/bitnami/influxdb)
# @default -- See values.yaml
influxdb:
  enabled: false
  architecture: standalone
  database: home_assistant
  authEnabled: false
  persistence:
    enabled: false
    # storageClass: ""
    # size: 8Gi

metrics:
  # -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
  # @default -- See values.yaml
  enabled: false
  serviceMonitor:
    interval: 1m
    scrapeTimeout: 30s
    labels: {}
    ## See https://www.home-assistant.io/docs/authentication/ for where to find
    ## long lived access token creation under your account profile, which is
    ## needed to monitor Home Assistant
    # bearerTokenSecret:
    #   name: ""
    #   key: ""

  # -- Enable and configure Prometheus Rules for the chart under this key.
  # @default -- See values.yaml
  prometheusRule:
    enabled: false
    labels: {}
    # -- Configure additionial rules for the chart under this key.
    # @default -- See prometheusrules.yaml
    rules: []
      # - alert: HomeAssistantAbsent
      #   annotations:
      #     description: Home Assistant has disappeared from Prometheus service discovery.
      #     summary: Home Assistant is down.
      #   expr: |
      #     absent(up{job=~".*home-assistant.*"} == 1)
      #   for: 5m
      #   labels:
      #     severity: critical