Skip to content

Commit 4319059

Browse files
committed
add optional PVC
1 parent 24c5e7d commit 4319059

File tree

6 files changed

+39
-4
lines changed

6 files changed

+39
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ Uses @mattlqx's [docker image](https://ghcr.io/mattlqx/docker-pixelfed) which is
1111

1212
- 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)
1313
- but you can also bring your own valkey, redis, or postgresql database
14+
- we're also looking for anyone who wants to test the mariadb subchart
1415
- helm parameter (values.yaml) docs autogenerated via [`helm-docs`](https://github.com/norwoodj/helm-docs) in [`README.md`](./charts/pixelfed/README.md)
1516
- use existing Secrets for valkey, postgresql, and mail (smtp)
1617
- RenovateBot keeps the subcharts and docker image up to date
1718
- configurable liveness and readiness probes (or none at all)
1819
- configure tolerations, affinity, nodeselectors
20+
- configure persistence with a PVC we create, or bring your own
1921
- use extra volumes, volumemounts, containers, initContainers
2022

2123
## TLDR

charts/pixelfed/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.18.0
18+
version: 0.19.0
1919

2020
# This is the version number of the application being deployed.
2121
# renovate:image=ghcr.io/mattlqx/docker-pixelfed

charts/pixelfed/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pixelfed
22

3-
![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)
3+
![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)
44

55
A Helm chart for deploying Pixelfed on Kubernetes
66

@@ -78,6 +78,9 @@ A Helm chart for deploying Pixelfed on Kubernetes
7878
| 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 |
7979
| nameOverride | string | `""` | This is to override the chart name. |
8080
| nodeSelector | object | `{}` | put the pixelfed pod on a specific node/nodegroup |
81+
| persistence.enabled | bool | `false` | enable persistence for the pixelfed pod |
82+
| persistence.existingClaim | string | `""` | using an existing PVC instead of creating one with this chart |
83+
| persistence.storage | string | `"2Gi"` | size of the persistent volume claim to create. Tgnored if persistence.existingClaim is set |
8184
| phpConfigs | object | `{}` | PHP Configuration files Will be injected in /usr/local/etc/php-fpm.d |
8285
| pixelfed.account_deletion | bool | `true` | Enable account deletion (may be a requirement in some jurisdictions) |
8386
| pixelfed.activity_pub.enabled | bool | `false` | enable ActivityPub |

charts/pixelfed/templates/deployment.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ spec:
259259
{{- toYaml . | nindent 12 }}
260260
{{- end }}
261261

262-
{{- if or .Values.extraVolumeMounts .Values.phpConfigs }}
262+
{{- if or .Values.extraVolumeMounts .Values.phpConfigs .Values.persistence.enabled }}
263263
volumeMounts:
264264
{{- with .Values.extraVolumeMounts }}
265265
{{- toYaml . | nindent 12 }}
@@ -269,13 +269,22 @@ spec:
269269
mountPath: {{ print "/usr/local/etc/php-fpm.d/%s" $key | quote }}
270270
subPath: {{ $key }}
271271
{{- end }}
272+
{{- if .Values.persistence.enabled }}
273+
- name: storage
274+
mountPath: /var/www/storage
275+
{{- end }}
272276
{{- end }}{{/* end volumeMounts */}}
273277

274-
{{- if or .Values.phpConfigs .Values.extraVolumes }}
278+
{{- if or .Values.phpConfigs .Values.extraVolumes .Values.persistence.enabled }}
275279
volumes:
276280
{{- with .Values.extraVolumes }}
277281
{{- toYaml . | nindent 8 }}
278282
{{- end }}
283+
{{- if .Values.persistence.enabled }}
284+
- name: storage
285+
persistentVolumeclaim:
286+
claimName: {{ .Values.persistence.existingClaim }}
287+
{{- end }}
279288
{{- if .Values.phpConfigs }}
280289
- name: phpconfig
281290
configMap:

charts/pixelfed/templates/pvc.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim ) }}
2+
---
3+
kind: PersistentVolumeClaim
4+
apiVersion: v1
5+
metadata:
6+
name: {{ include "pixelfed.fullname" . }}
7+
spec:
8+
accessModes:
9+
- ReadWriteOnce
10+
resources:
11+
requests:
12+
storage: {{ .Values.persistence.storage }}
13+
{{- end }}

charts/pixelfed/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ phpConfigs: {}
306306
# pm.min_spare_servers = 100
307307
# pm.max_spare_servers = 280
308308

309+
persistence:
310+
# -- enable persistence for the pixelfed pod
311+
enabled: false
312+
# -- size of the persistent volume claim to create. Tgnored if persistence.existingClaim is set
313+
storage: 2Gi
314+
# -- using an existing PVC instead of creating one with this chart
315+
existingClaim: ""
316+
309317
pixelfed:
310318
db:
311319
# -- options: sqlite mysql pgsql sqlsrv

0 commit comments

Comments
 (0)