Add PVC for sqlite database for homeassistant.
All checks were successful
ci/woodpecker/push/homeassistant Pipeline was successful

This commit is contained in:
Alex Manning 2023-04-23 12:02:35 +01:00
parent a445394557
commit 665301022f
3 changed files with 34 additions and 0 deletions

View file

@ -68,6 +68,8 @@ spec:
mountPath: /config
- name: storage
mountPath: /media/storage
- name: database
mountPath: /media/database
- name: certificate-secret
mountPath: /media/certificates
- name: main-configmap
@ -117,6 +119,13 @@ spec:
{{- else }}
claimName: {{ .Values.pvc.storage.existingClaim }}
{{- end }}
- name: database
persistentVolumeClaim:
{{- if not .Values.pvc.database.existingClaim }}
claimName: {{ include "homeassistant.fullname" . }}-database
{{- else }}
claimName: {{ .Values.pvc.database.existingClaim }}
{{- end }}
- name: init
configMap:
name: {{ include "homeassistant.fullname" . }}-initscript

View file

@ -33,3 +33,21 @@ spec:
requests:
storage: {{ .Values.pvc.storage.storage | quote }}
{{- end }}
---
{{- if not .Values.pvc.database.existingClaim -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "homeassistant.fullname" . }}-database
labels:
{{- include "homeassistant.labels" . | nindent 4 }}
annotations:
helm.sh/resource-policy: "keep"
spec:
accessModes:
- ReadWriteOnce
storageClassName: {{ .Values.pvc.database.storageClassName | quote }}
resources:
requests:
storage: {{ .Values.pvc.database.storage | quote }}
{{- end }}

View file

@ -56,6 +56,11 @@ pvc:
existingClaim: false
storageClassName: ""
storage: "5Gi"
database:
existingClaim: false
storageClassName: ""
storage: "5Gi"
mainConfig:
http:
@ -63,6 +68,8 @@ mainConfig:
ssl_certificate: /media/certificates/tls.crt
ssl_key: /media/certificates/tls.key
use_x_forwarded_for: true
recorder:
db_url: sqlite:////media/database/hass-db.sqlite
config:
packages: ""