Merge pull request #54 from small-hack/feature/persistence

add optional PVC
This commit is contained in:
Jesse Hitch
2025-01-23 23:25:43 +01:00
committed by GitHub
6 changed files with 51 additions and 4 deletions
+2
View File
@@ -11,11 +11,13 @@ Uses @mattlqx's [docker image](https://ghcr.io/mattlqx/docker-pixelfed) which is
- includes bitnami subcharts for [valkey](https://github.com/bitnami/charts/blob/main/bitnami/valkey/README.md#parameters) (redis) and [postgresql](https://github.com/bitnami/charts/blob/main/bitnami/postgresql/README.md#parameters) (database)
- but you can also bring your own valkey, redis, or postgresql database
- we're also looking for anyone who wants to test the mariadb subchart
- helm parameter (values.yaml) docs autogenerated via [`helm-docs`](https://github.com/norwoodj/helm-docs) in [`README.md`](./charts/pixelfed/README.md)
- use existing Secrets for valkey, postgresql, and mail (smtp)
- RenovateBot keeps the subcharts and docker image up to date
- configurable liveness and readiness probes (or none at all)
- configure tolerations, affinity, nodeselectors
- configure persistence with a PVC we create, or bring your own
- use extra volumes, volumemounts, containers, initContainers
## TLDR
+1 -1
View File
@@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.18.0
version: 0.19.0
# This is the version number of the application being deployed.
# renovate:image=ghcr.io/mattlqx/docker-pixelfed
+6 -1
View File
@@ -1,6 +1,6 @@
# pixelfed
![Version: 0.18.0](https://img.shields.io/badge/Version-0.18.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.12.4-nginx](https://img.shields.io/badge/AppVersion-v0.12.4--nginx-informational?style=flat-square)
![Version: 0.19.0](https://img.shields.io/badge/Version-0.19.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.12.4-nginx](https://img.shields.io/badge/AppVersion-v0.12.4--nginx-informational?style=flat-square)
A Helm chart for deploying Pixelfed on Kubernetes
@@ -78,6 +78,11 @@ A Helm chart for deploying Pixelfed on Kubernetes
| mariadb.enabled | bool | `false` | enable mariadb subchart - currently experimental for this chart read more about the values: https://github.com/bitnami/charts/tree/main/bitnami/mariadb |
| nameOverride | string | `""` | This is to override the chart name. |
| nodeSelector | object | `{}` | put the pixelfed pod on a specific node/nodegroup |
| persistence.accessModes | list | `["ReadWriteOnce"]` | accessMode |
| persistence.enabled | bool | `false` | enable persistence for the pixelfed pod |
| persistence.existingClaim | string | `""` | using an existing PVC instead of creating one with this chart |
| persistence.storage | string | `"2Gi"` | size of the persistent volume claim to create. Tgnored if persistence.existingClaim is set |
| persistence.storageClassName | string | `""` | storage class name |
| phpConfigs | object | `{}` | PHP Configuration files Will be injected in /usr/local/etc/php-fpm.d |
| pixelfed.account_deletion | bool | `true` | Enable account deletion (may be a requirement in some jurisdictions) |
| pixelfed.activity_pub.enabled | bool | `false` | enable ActivityPub |
+15 -2
View File
@@ -259,7 +259,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if or .Values.extraVolumeMounts .Values.phpConfigs }}
{{- if or .Values.extraVolumeMounts .Values.phpConfigs .Values.persistence.enabled }}
volumeMounts:
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
@@ -269,13 +269,26 @@ spec:
mountPath: {{ print "/usr/local/etc/php-fpm.d/%s" $key | quote }}
subPath: {{ $key }}
{{- end }}
{{- if .Values.persistence.enabled }}
- name: storage
mountPath: /var/www/storage
{{- end }}
{{- end }}{{/* end volumeMounts */}}
{{- if or .Values.phpConfigs .Values.extraVolumes }}
{{- if or .Values.phpConfigs .Values.extraVolumes .Values.persistence.enabled }}
volumes:
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.persistence.enabled }}
- name: storage
persistentVolumeClaim:
{{- if .Values.persistence.existingClaim }}
claimName: {{ .Values.persistence.existingClaim }}
{{- else }}
claimName: {{ include "pixelfed.fullname" . }}
{{- end }}
{{- end }}
{{- if .Values.phpConfigs }}
- name: phpconfig
configMap:
+14
View File
@@ -0,0 +1,14 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim ) }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "pixelfed.fullname" . }}
spec:
storageClassName: {{ .Values.persistence.storageClassName }}
accessModes:
{{- toYaml .Values.persistence.accessModes | indent 4 }}
resources:
requests:
storage: {{ .Values.persistence.storage }}
{{- end }}
+13
View File
@@ -306,6 +306,19 @@ phpConfigs: {}
# pm.min_spare_servers = 100
# pm.max_spare_servers = 280
persistence:
# -- enable persistence for the pixelfed pod
enabled: false
# -- storage class name
storageClassName: ""
# -- size of the persistent volume claim to create. Tgnored if persistence.existingClaim is set
storage: 2Gi
# -- accessMode
accessModes:
- ReadWriteOnce
# -- using an existing PVC instead of creating one with this chart
existingClaim: ""
pixelfed:
db:
# -- options: sqlite mysql pgsql sqlsrv