homeassistant.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: homeassistant
  5. namespace: homeassistant
  6. spec:
  7. replicas: 1
  8. selector:
  9. matchLabels:
  10. name: homeassistant
  11. template:
  12. metadata:
  13. namespace: homeassistant
  14. labels:
  15. name: homeassistant
  16. spec:
  17. affinity:
  18. nodeAffinity:
  19. requiredDuringSchedulingIgnoredDuringExecution:
  20. nodeSelectorTerms:
  21. - matchExpressions:
  22. - key: net
  23. operator: In
  24. values:
  25. - local
  26. - key: has_bluetooth
  27. operator: In
  28. values:
  29. - "true"
  30. hostNetwork: true
  31. containers:
  32. - name: homeassistant
  33. image: ghcr.io/home-assistant/home-assistant:stable
  34. imagePullPolicy: "Always"
  35. env:
  36. - name: TZ
  37. value: "Europe/Zurich"
  38. volumeMounts:
  39. - name: homeassistant
  40. mountPath: /config
  41. - name: dbus-socket
  42. mountPath: /var/run/dbus/system_bus_socket
  43. ports:
  44. - containerPort: 8123
  45. name: http
  46. volumes:
  47. - name: homeassistant
  48. persistentVolumeClaim:
  49. claimName: homeassistant
  50. - name: dbus-socket
  51. hostPath:
  52. path: /var/run/dbus/system_bus_socket
  53. type: Socket
  54. ---
  55. apiVersion: v1
  56. kind: Service
  57. metadata:
  58. name: homeassistant
  59. namespace: homeassistant
  60. spec:
  61. ipFamilyPolicy: PreferDualStack
  62. type: NodePort
  63. selector:
  64. name: homeassistant
  65. ports:
  66. - protocol: TCP
  67. port: 8123
  68. targetPort: http
  69. nodePort: 31823
  70. name: http
  71. ---
  72. apiVersion: v1
  73. kind: PersistentVolumeClaim
  74. metadata:
  75. name: homeassistant
  76. namespace: homeassistant
  77. spec:
  78. storageClassName: nfs-vrt
  79. accessModes:
  80. - ReadWriteMany
  81. resources:
  82. requests:
  83. storage: 300Mi
  84. ---
  85. apiVersion: networking.k8s.io/v1
  86. kind: Ingress
  87. metadata:
  88. namespace: homeassistant
  89. name: homeassistant-ingress
  90. annotations:
  91. cert-manager.io/cluster-issuer: "letsencrypt"
  92. acme.cert-manager.io/http01-edit-in-place: "true"
  93. nginx.org/client-max-body-size: "500m"
  94. nginx.org/proxy-connect-timeout: "60s"
  95. nginx.org/proxy-read-timeout: "60s"
  96. nginx.org/hsts: "True"
  97. nginx.org/hsts-max-age: "15552000"
  98. # Uncomment to allow solving HTTP01 challenge
  99. nginx.org/redirect-to-https: "true"
  100. nginx.org/location-snippets: |
  101. proxy_set_header Upgrade $http_upgrade;
  102. proxy_set_header Connection "upgrade";
  103. spec:
  104. tls:
  105. - hosts:
  106. - ha.dodges.it
  107. secretName: ha-le-secret
  108. rules:
  109. - host: ha.dodges.it
  110. http:
  111. paths:
  112. - path: /
  113. pathType: Prefix
  114. backend:
  115. service:
  116. name: homeassistant
  117. port:
  118. number: 8123
  119. ingressClassName: nginx