Skip to content

Commit 79b8a5c

Browse files
authored
Merge pull request #24 from small-hack/allow-setting-extra-envs
allow extra env, extra envFrom, extra InitContainers, and extra sidecars
2 parents ed874ac + a7f81d8 commit 79b8a5c

File tree

4 files changed

+55
-13
lines changed

4 files changed

+55
-13
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.9.0
18+
version: 0.10.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: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pixelfed
22

3-
![Version: 0.9.0](https://img.shields.io/badge/Version-0.9.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.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)
44

55
A Helm chart for deploying Pixelfed on Kubernetes
66

@@ -21,11 +21,11 @@ A Helm chart for deploying Pixelfed on Kubernetes
2121

2222
| Key | Type | Default | Description |
2323
|-----|------|---------|-------------|
24-
| affinity | object | `{}` | |
25-
| autoscaling.enabled | bool | `false` | |
26-
| autoscaling.maxReplicas | int | `100` | |
27-
| autoscaling.minReplicas | int | `1` | |
28-
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
24+
| affinity | object | `{}` | set affinity to specific nodes or nodegroups |
25+
| autoscaling.enabled | bool | `false` | enable autoscaling. more information can be found [here](https://kubernetes.io/docs/concepts/workloads/autoscaling/) |
26+
| autoscaling.maxReplicas | int | `100` | max replicas to scale up to |
27+
| autoscaling.minReplicas | int | `1` | minimum replicas to always keep up |
28+
| autoscaling.targetCPUUtilizationPercentage | int | `80` | CPU limit a pod needs to hit to start autoscaling new pods |
2929
| externalDatabase.database | string | `"pixelfed"` | |
3030
| externalDatabase.enabled | bool | `false` | enable using an external mysql or postgresql cluster |
3131
| externalDatabase.existingSecret | string | `""` | get database credentials from an existing Kubernetes Secret |
@@ -48,6 +48,10 @@ A Helm chart for deploying Pixelfed on Kubernetes
4848
| externalValkey.password | string | `"null"` | |
4949
| externalValkey.port | string | `"6379"` | |
5050
| externalValkey.scheme | string | `"tcp"` | |
51+
| extraContainers | list | `[]` | set sidecar containers to run along side the pixelfed container |
52+
| extraEnv | list | `[]` | template out extra environment variables from ConfigMaps or Secrets |
53+
| extraEnvFrom | list | `[]` | template out extra enviornment variables |
54+
| extraInitContainers | list | `[]` | set extra init containers |
5155
| fullnameOverride | string | `""` | This is to override the chart name, but used in more places |
5256
| image.pullPolicy | string | `"IfNotPresent"` | This sets the pull policy for images. |
5357
| image.registry | string | `"ghcr.io"` | |
@@ -63,7 +67,7 @@ A Helm chart for deploying Pixelfed on Kubernetes
6367
| ingress.tls | list | `[]` | |
6468
| 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/ |
6569
| nameOverride | string | `""` | This is to override the chart name. |
66-
| nodeSelector | object | `{}` | |
70+
| nodeSelector | object | `{}` | put the pixelfed pod on a specific node/nodegroup |
6771
| pixelfed.account_deletion | bool | `true` | Enable account deletion (may be a requirement in some jurisdictions) |
6872
| pixelfed.activity_pub.enabled | bool | `false` | enable ActivityPub |
6973
| pixelfed.activity_pub.inbox | bool | `false` | |
@@ -154,23 +158,23 @@ A Helm chart for deploying Pixelfed on Kubernetes
154158
| pixelfed.webfinger | string | `"true"` | https://docs.pixelfed.org/technical-documentation/config/#webfinger |
155159
| podAnnotations | object | `{}` | This is for setting Kubernetes Annotations to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ |
156160
| podLabels | object | `{}` | This is for setting Kubernetes Labels to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ |
157-
| podSecurityContext | object | `{}` | |
161+
| podSecurityContext | object | `{}` | securityContext for the whole pod |
158162
| postgresql.enabled | bool | `true` | enable the bundled [postgresql sub chart from Bitnami](https://github.com/bitnami/charts/blob/main/bitnami/postgresql/README.md#parameters). Must set to true if externalDatabase.enabled=false |
159163
| postgresql.fullnameOverride | string | `"postgresql"` | |
160164
| postgresql.global.storageClass | string | `""` | |
161165
| readinessProbe | object | `{}` | This is to setup the readiness probe more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ |
162166
| replicaCount | int | `1` | This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ |
163167
| resources | object | `{}` | set resource limits and requests for cpu, memory, and ephemeral storage |
164168
| revisionHistoryLimit | int | `10` | how many revisions of the deployment to keep for rollbacks |
165-
| securityContext | object | `{}` | |
169+
| securityContext | object | `{}` | securityContext for the pixelfed container |
166170
| service.port | int | `80` | This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports |
167171
| service.targetPort | int | `80` | Port to attach to on the pods. Also sets what port nginx listens on inside the container. |
168172
| service.type | string | `"ClusterIP"` | This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types |
169173
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
170174
| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? |
171175
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
172176
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
173-
| tolerations | list | `[]` | |
177+
| tolerations | list | `[]` | set tolerations of node taints |
174178
| valkey.auth.enabled | bool | `true` | |
175179
| valkey.auth.existingSecret | string | `""` | |
176180
| valkey.auth.existingSecretPasswordKey | string | `"password"` | |

charts/pixelfed/templates/deployment.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ spec:
3333
securityContext:
3434
{{- toYaml . | nindent 8 }}
3535
{{- end }}
36+
{{- with .Values.extraInitContainers }}
37+
initContainers:
38+
{{- toYaml . | nindent 8 }}
39+
{{- end }}
3640
containers:
41+
{{- with .Values.extraContainers }}
42+
{{- toYaml . | nindent 10 }}
43+
{{- end }}
3744
- name: {{ .Chart.Name }}
3845
{{- with .Values.securityContext }}
3946
securityContext:
@@ -45,10 +52,18 @@ spec:
4552
- name: http
4653
containerPort: {{ .Values.service.targetPort }}
4754
protocol: TCP
55+
4856
envFrom:
57+
{{- with .Values.extraEnvFrom }}
58+
{{- toYaml . | nindent 12 }}
59+
{{- end }}
4960
- configMapRef:
5061
name: {{ include "pixelfed.fullname" . }}-env
5162
env:
63+
{{- with .Values.extraEnv }}
64+
{{- toYaml . | nindent 12 }}
65+
{{- end }}
66+
5267
# valkey AKA redis
5368
{{- if and .Values.externalValkey.enabled .Values.externalValkey.existingSecretKeys.host }}
5469
- name: REDIS_HOST
@@ -104,6 +119,7 @@ spec:
104119
name: {{ include "pixelfed.fullname" . }}-mail
105120
key: host
106121
{{- end }}
122+
107123
- name: MAIL_PORT
108124
valueFrom:
109125
secretKeyRef:
@@ -114,6 +130,7 @@ spec:
114130
name: {{ include "pixelfed.fullname" . }}-mail
115131
key: port
116132
{{- end }}
133+
117134
- name: MAIL_USERNAME
118135
valueFrom:
119136
secretKeyRef:
@@ -124,6 +141,7 @@ spec:
124141
name: {{ include "pixelfed.fullname" . }}-mail
125142
key: username
126143
{{- end }}
144+
127145
- name: MAIL_PASSWORD
128146
valueFrom:
129147
secretKeyRef:

charts/pixelfed/values.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ fullnameOverride: ""
2626
# -- how many revisions of the deployment to keep for rollbacks
2727
revisionHistoryLimit: 10
2828

29+
# -- template out extra environment variables from ConfigMaps or Secrets
30+
extraEnv: []
31+
32+
# -- template out extra enviornment variables
33+
extraEnvFrom: []
34+
2935
# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
3036
serviceAccount:
3137
# -- Specifies whether a service account should be created
@@ -41,13 +47,16 @@ serviceAccount:
4147
# -- This is for setting Kubernetes Annotations to a Pod.
4248
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
4349
podAnnotations: {}
50+
4451
# -- This is for setting Kubernetes Labels to a Pod.
4552
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
4653
podLabels: {}
4754

55+
# -- securityContext for the whole pod
4856
podSecurityContext: {}
4957
# fsGroup: 2000
5058

59+
# -- securityContext for the pixelfed container
5160
securityContext: {}
5261
# capabilities:
5362
# drop:
@@ -107,12 +116,14 @@ readinessProbe: {}
107116
# path: /api/service/health-check
108117
# port: http
109118

110-
# This section is for setting up autoscaling
111-
# more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
112119
autoscaling:
120+
# -- enable autoscaling. more information can be found [here](https://kubernetes.io/docs/concepts/workloads/autoscaling/)
113121
enabled: false
122+
# -- minimum replicas to always keep up
114123
minReplicas: 1
124+
# -- max replicas to scale up to
115125
maxReplicas: 100
126+
# -- CPU limit a pod needs to hit to start autoscaling new pods
116127
targetCPUUtilizationPercentage: 80
117128
# targetMemoryUtilizationPercentage: 80
118129

@@ -129,10 +140,19 @@ volumeMounts: []
129140
# mountPath: "/etc/foo"
130141
# readOnly: true
131142

143+
# -- set extra init containers
144+
extraInitContainers: []
145+
146+
# -- set sidecar containers to run along side the pixelfed container
147+
extraContainers: []
148+
149+
# -- put the pixelfed pod on a specific node/nodegroup
132150
nodeSelector: {}
133151

152+
# -- set tolerations of node taints
134153
tolerations: []
135154

155+
# -- set affinity to specific nodes or nodegroups
136156
affinity: {}
137157

138158
externalDatabase:

0 commit comments

Comments
 (0)