mirror of
https://github.com/shadoll/helm-charts.git
synced 2026-08-28 03:27:08 +00:00
feat: Add persistent volume claim support for backups and update Helm chart version
This commit is contained in:
@@ -5,5 +5,5 @@ type: application
|
||||
annotations:
|
||||
version-source: github-release:home-assistant/core
|
||||
version-pattern: "s|^v||"
|
||||
version: 0.1.10
|
||||
version: 0.1.13
|
||||
appVersion: "2026.3.4"
|
||||
|
||||
@@ -40,9 +40,14 @@ spec:
|
||||
mountPath: /backup
|
||||
volumes:
|
||||
- name: backup-storage
|
||||
{{- if .Values.backup.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.backup.persistence.existingClaim | default (printf "%s-db-backup" (include "home-assistant.fullname" .)) }}
|
||||
{{- else }}
|
||||
hostPath:
|
||||
path: {{ .Values.backup.storagePath }}
|
||||
type: DirectoryOrCreate
|
||||
{{- end }}
|
||||
restartPolicy: OnFailure
|
||||
{{- if .Values.backup.node }}
|
||||
affinity:
|
||||
|
||||
@@ -119,6 +119,10 @@ spec:
|
||||
- name: media
|
||||
mountPath: {{ .Values.persistence.media.mountPath }}
|
||||
{{- end }}
|
||||
{{- if .Values.persistence.backups.enabled }}
|
||||
- name: backups
|
||||
mountPath: /config/backups
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumes:
|
||||
@@ -144,6 +148,11 @@ spec:
|
||||
claimName: {{ .Values.persistence.media.existingClaim | default (printf "%s-media" (include "home-assistant.fullname" .)) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.persistence.backups.enabled }}
|
||||
- name: backups
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.backups.existingClaim | default (printf "%s-backups" (include "home-assistant.fullname" .)) }}
|
||||
{{- end }}
|
||||
{{- if .Values.haSecrets.enabled }}
|
||||
- name: ha-secrets
|
||||
secret:
|
||||
|
||||
@@ -46,4 +46,54 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- if .Values.persistence.backups.enabled }}
|
||||
{{- if eq (.Values.persistence.backups.type | default "pvc") "pvc" }}
|
||||
{{- if not .Values.persistence.backups.existingClaim }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "home-assistant.fullname" . }}-backups
|
||||
{{- if .Values.namespaceOverride }}
|
||||
namespace: {{ .Values.namespaceOverride }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "home-assistant.labels" . | nindent 4 }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- toYaml (.Values.persistence.backups.accessModes | default (list "ReadWriteOnce")) | nindent 4 }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.backups.size | default "10Gi" | quote }}
|
||||
{{- if .Values.persistence.backups.storageClass }}
|
||||
storageClassName: {{ .Values.persistence.backups.storageClass | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- if .Values.backup.enabled }}
|
||||
{{- if .Values.backup.persistence.enabled }}
|
||||
{{- if not .Values.backup.persistence.existingClaim }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "home-assistant.fullname" . }}-db-backup
|
||||
{{- if .Values.namespaceOverride }}
|
||||
namespace: {{ .Values.namespaceOverride }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "home-assistant.labels" . | nindent 4 }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- toYaml (.Values.backup.persistence.accessModes | default (list "ReadWriteOnce")) | nindent 4 }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.backup.persistence.size | default "10Gi" | quote }}
|
||||
{{- if .Values.backup.persistence.storageClass }}
|
||||
storageClassName: {{ .Values.backup.persistence.storageClass | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -48,17 +48,29 @@ resources:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
type: hostPath
|
||||
hostPath: /srv/data/home-assistant/config
|
||||
type: pvc
|
||||
mountPath: /config
|
||||
size: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClass: ""
|
||||
# hostPath: /srv/data/home-assistant/config # only when type: hostPath
|
||||
media:
|
||||
enabled: true
|
||||
hostPath: /srv/data/home-assistant/media
|
||||
type: pvc
|
||||
mountPath: /media
|
||||
size: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClass: ""
|
||||
# hostPath: /srv/data/home-assistant/media # only when type: hostPath
|
||||
backups:
|
||||
enabled: false
|
||||
type: pvc
|
||||
size: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClass: ""
|
||||
|
||||
haSecrets:
|
||||
enabled: false
|
||||
@@ -97,6 +109,12 @@ backup:
|
||||
storagePath: /storage/backups/postgres
|
||||
# Node to run backup on (hostname). Overrides global affinity/tolerations.
|
||||
node: ""
|
||||
persistence:
|
||||
enabled: false
|
||||
size: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClass: ""
|
||||
postgres:
|
||||
host: postgres-tcp.postgres.svc.cluster.local
|
||||
db: homeassistant
|
||||
|
||||
Reference in New Issue
Block a user