Skip to content

Commit aef586e

Browse files
authored
Merge pull request #25 from small-hack/allow-updating-php-configs
update extra volumes to allow php config updates; also reload deployment on configmap changes
2 parents 1ec6aa2 + 2250a1c commit aef586e

File tree

6 files changed

+70
-16
lines changed

6 files changed

+70
-16
lines changed

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.10.0
18+
version: 0.11.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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pixelfed
22

3-
![Version: 0.10.0](https://img.shields.io/badge/Version-0.10.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.11.0](https://img.shields.io/badge/Version-0.11.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

@@ -52,6 +52,8 @@ A Helm chart for deploying Pixelfed on Kubernetes
5252
| extraEnv | list | `[]` | template out extra environment variables from ConfigMaps or Secrets |
5353
| extraEnvFrom | list | `[]` | template out extra enviornment variables |
5454
| extraInitContainers | list | `[]` | set extra init containers |
55+
| extraVolumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition |
56+
| extraVolumes | list | `[]` | Additional volumes on the output Deployment definition |
5557
| fullnameOverride | string | `""` | This is to override the chart name, but used in more places |
5658
| image.pullPolicy | string | `"IfNotPresent"` | This sets the pull policy for images. |
5759
| image.registry | string | `"ghcr.io"` | |
@@ -68,6 +70,7 @@ A Helm chart for deploying Pixelfed on Kubernetes
6870
| livenessProbe | object | `{}` | This is to setup the liveness probe more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ |
6971
| nameOverride | string | `""` | This is to override the chart name. |
7072
| nodeSelector | object | `{}` | put the pixelfed pod on a specific node/nodegroup |
73+
| phpConfigs | object | `{}` | PHP Configuration files Will be injected in /usr/local/etc/php-fpm.d |
7174
| pixelfed.account_deletion | bool | `true` | Enable account deletion (may be a requirement in some jurisdictions) |
7275
| pixelfed.activity_pub.enabled | bool | `false` | enable ActivityPub |
7376
| pixelfed.activity_pub.inbox | bool | `false` | |
@@ -194,8 +197,6 @@ A Helm chart for deploying Pixelfed on Kubernetes
194197
| valkey.tls.authClients | bool | `true` | |
195198
| valkey.tls.autoGenerated | bool | `false` | |
196199
| valkey.tls.enabled | bool | `false` | |
197-
| volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition. |
198-
| volumes | list | `[]` | Additional volumes on the output Deployment definition. |
199200

200201
----------------------------------------------
201202
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.phpConfigs -}}
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: {{ template "pixelfed.fullname" . }}-phpconfig
7+
data:
8+
{{- range $key, $value := .Values.phpConfigs }}
9+
{{ $key }}: |-
10+
{{- $value | nindent 4 }}
11+
{{- end }}
12+
{{- end }}

charts/pixelfed/templates/deployment.yaml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ spec:
1414
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
1515
template:
1616
metadata:
17-
{{- with .Values.podAnnotations }}
1817
annotations:
19-
{{- toYaml . | nindent 8 }}
20-
{{- end }}
18+
# reload deployment if config files change
19+
php-config-hash: {{ toJson .Values.phpConfigs | sha256sum }}
20+
checksum/config: {{ include (print $.Template.BasePath "/configmap_env.yaml") . | sha256sum }}
21+
{{- with .Values.podAnnotations }}
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
2124
labels:
2225
{{- include "pixelfed.labels" . | nindent 8 }}
2326
{{- with .Values.podLabels }}
@@ -228,19 +231,39 @@ spec:
228231
livenessProbe:
229232
{{- toYaml . | nindent 12 }}
230233
{{- end }}
234+
231235
{{- with .Values.readinessProbe }}
232236
readinessProbe:
233237
{{- toYaml . | nindent 12 }}
234238
{{- end }}
239+
240+
{{- with .Values.resources }}
235241
resources:
236-
{{- toYaml .Values.resources | nindent 12 }}
237-
{{- with .Values.volumeMounts }}
238-
volumeMounts:
239242
{{- toYaml . | nindent 12 }}
240243
{{- end }}
241-
{{- with .Values.volumes }}
244+
245+
{{- if or .Values.extraVolumeMounts .Values.phpConfigs }}
246+
volumeMounts:
247+
{{- with .Values.extraVolumeMounts }}
248+
{{- toYaml . | nindent 12 }}
249+
{{- end }}
250+
{{- range $key, $value := .Values.phpConfigs }}
251+
- name: phpconfig
252+
mountPath: {{ "/usr/local/etc/php-fpm.d/%s" $key | quote }}
253+
subPath: {{ $key }}
254+
{{- end }}
255+
{{- end }}{{/* end volumeMounts */}}
256+
257+
{{- if or .Values.phpConfigs .Values.extraVolumes }}
242258
volumes:
243-
{{- toYaml . | nindent 8 }}
259+
{{- with .Values.extraVolumes }}
260+
{{- toYaml . | nindent 8 }}
261+
{{- end }}
262+
{{- if .Values.phpConfigs }}
263+
- name: phpconfig
264+
configMap:
265+
name: {{ template "pixelfed.fullname" . }}-phpconfig
266+
{{- end }}
244267
{{- end }}
245268
{{- with .Values.nodeSelector }}
246269
nodeSelector:

charts/pixelfed/values.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ autoscaling:
127127
targetCPUUtilizationPercentage: 80
128128
# targetMemoryUtilizationPercentage: 80
129129

130-
# -- Additional volumes on the output Deployment definition.
131-
volumes: []
130+
# -- Additional volumes on the output Deployment definition
131+
extraVolumes: []
132132
# - name: foo
133133
# secret:
134134
# secretName: mysecret
135135
# optional: false
136136

137-
# -- Additional volumeMounts on the output Deployment definition.
138-
volumeMounts: []
137+
# -- Additional volumeMounts on the output Deployment definition
138+
extraVolumeMounts: []
139139
# - name: foo
140140
# mountPath: "/etc/foo"
141141
# readOnly: true
@@ -266,6 +266,24 @@ postgresql:
266266
global:
267267
storageClass: ""
268268

269+
270+
# -- PHP Configuration files
271+
# Will be injected in /usr/local/etc/php-fpm.d
272+
phpConfigs: {}
273+
# www.conf: |-
274+
# [www]
275+
# user = www-data
276+
# group = www-data
277+
# www.conf: |-
278+
# [www]
279+
# security.limit_extensions = .php .css .js .html
280+
# listen = 127.0.0.1:9000
281+
# pm = dynamic
282+
# pm.max_children = 350
283+
# pm.start_servers = 100
284+
# pm.min_spare_servers = 100
285+
# pm.max_spare_servers = 280
286+
269287
pixelfed:
270288
db:
271289
# -- options: sqlite mysql pgsql sqlsrv

0 commit comments

Comments
 (0)