diff --git a/README.md b/README.md index 2ecd0af..df66b22 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/charts/pixelfed/Chart.yaml b/charts/pixelfed/Chart.yaml index 8395e44..37bc5db 100644 --- a/charts/pixelfed/Chart.yaml +++ b/charts/pixelfed/Chart.yaml @@ -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 diff --git a/charts/pixelfed/README.md b/charts/pixelfed/README.md index fd588f1..ef38624 100644 --- a/charts/pixelfed/README.md +++ b/charts/pixelfed/README.md @@ -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 | diff --git a/charts/pixelfed/templates/deployment.yaml b/charts/pixelfed/templates/deployment.yaml index 9b3867c..6dc4154 100644 --- a/charts/pixelfed/templates/deployment.yaml +++ b/charts/pixelfed/templates/deployment.yaml @@ -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: diff --git a/charts/pixelfed/templates/pvc.yaml b/charts/pixelfed/templates/pvc.yaml new file mode 100644 index 0000000..fa34630 --- /dev/null +++ b/charts/pixelfed/templates/pvc.yaml @@ -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 }} diff --git a/charts/pixelfed/values.yaml b/charts/pixelfed/values.yaml index dad34fd..906729a 100644 --- a/charts/pixelfed/values.yaml +++ b/charts/pixelfed/values.yaml @@ -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