diff --git a/charts/pixelfed/Chart.yaml b/charts/pixelfed/Chart.yaml index b298358..64ad9ea 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.10.0 +version: 0.11.0 # This is the version number of the application being deployed. # renovate:image=ghcr.io/mattlqx/docker-pixelfed diff --git a/charts/pixelfed/templates/configmap-env.yaml b/charts/pixelfed/templates/configmap_env.yaml similarity index 100% rename from charts/pixelfed/templates/configmap-env.yaml rename to charts/pixelfed/templates/configmap_env.yaml diff --git a/charts/pixelfed/templates/configmap_php.yaml b/charts/pixelfed/templates/configmap_php.yaml new file mode 100644 index 0000000..ece69fb --- /dev/null +++ b/charts/pixelfed/templates/configmap_php.yaml @@ -0,0 +1,12 @@ +{{- if .Values.phpConfigs -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "pixelfed.fullname" . }}-phpconfig +data: + {{- range $key, $value := .Values.phpConfigs }} + {{ $key }}: |- + {{- $value | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/pixelfed/templates/deployment.yaml b/charts/pixelfed/templates/deployment.yaml index 1a75d29..ec0a4ae 100644 --- a/charts/pixelfed/templates/deployment.yaml +++ b/charts/pixelfed/templates/deployment.yaml @@ -14,10 +14,13 @@ spec: revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} template: metadata: - {{- with .Values.podAnnotations }} annotations: - {{- toYaml . | nindent 8 }} - {{- end }} + # reload deployment if config files change + php-config-hash: {{ toJson .Values.phpConfigs | sha256sum }} + checksum/config: {{ include (print $.Template.BasePath "/configmap_env.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} labels: {{- include "pixelfed.labels" . | nindent 8 }} {{- with .Values.podLabels }} @@ -228,19 +231,39 @@ spec: livenessProbe: {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.readinessProbe }} readinessProbe: {{- toYaml . | nindent 12 }} {{- end }} + + {{- with .Values.resources }} resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.volumeMounts }} - volumeMounts: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.volumes }} + + {{- if or .Values.extraVolumeMounts .Values.phpConfigs }} + volumeMounts: + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- range $key, $value := .Values.phpConfigs }} + - name: phpconfig + mountPath: {{ "/usr/local/etc/php-fpm.d/%s" $key | quote }} + subPath: {{ $key }} + {{- end }} + {{- end }}{{/* end volumeMounts */}} + + {{- if or .Values.phpConfigs .Values.extraVolumes }} volumes: - {{- toYaml . | nindent 8 }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.phpConfigs }} + - name: phpconfig + configMap: + name: {{ template "pixelfed.fullname" . }}-phpconfig + {{- end }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/pixelfed/values.yaml b/charts/pixelfed/values.yaml index 613a5d6..9f8b5bf 100644 --- a/charts/pixelfed/values.yaml +++ b/charts/pixelfed/values.yaml @@ -127,15 +127,15 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 -# -- Additional volumes on the output Deployment definition. -volumes: [] +# -- Additional volumes on the output Deployment definition +extraVolumes: [] # - name: foo # secret: # secretName: mysecret # optional: false -# -- Additional volumeMounts on the output Deployment definition. -volumeMounts: [] +# -- Additional volumeMounts on the output Deployment definition +extraVolumeMounts: [] # - name: foo # mountPath: "/etc/foo" # readOnly: true @@ -266,6 +266,24 @@ postgresql: global: storageClass: "" + +# -- PHP Configuration files +# Will be injected in /usr/local/etc/php-fpm.d +phpConfigs: {} + # www.conf: |- + # [www] + # user = www-data + # group = www-data + # www.conf: |- + # [www] + # security.limit_extensions = .php .css .js .html + # listen = 127.0.0.1:9000 + # pm = dynamic + # pm.max_children = 350 + # pm.start_servers = 100 + # pm.min_spare_servers = 100 + # pm.max_spare_servers = 280 + pixelfed: db: # -- options: sqlite mysql pgsql sqlsrv