Skip to content

Commit d2d9ba8

Browse files
authored
Allow custom pod labels and annotations (#709)
1 parent fc5cfc7 commit d2d9ba8

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

charts/matrix/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ A Helm chart to deploy a Matrix homeserver stack on Kubernetes
433433
| element.labels | object | `{"component":"element"}` | Element specific labels |
434434
| element.labs | list | `["feature_new_spinner","feature_pinning","feature_custom_status","feature_custom_tags","feature_state_counters","feature_many_integration_managers","feature_mjolnir","feature_dm_verification","feature_bridge_state","feature_presence_in_room_list","feature_custom_themes"]` | Experimental features in Element, see: https://github.com/vector-im/element-web/blob/develop/docs/labs.md |
435435
| element.permalinkPrefix | string | `"https://matrix.to"` | Prefix before permalinks generated when users share links to rooms, users, or messages. If running an unfederated Synapse, set the below to the URL of your Element instance. |
436+
| element.podAnnotations | object | `{}` | |
437+
| element.podLabels | object | `{}` | |
436438
| element.probes.liveness | object | `{}` | |
437439
| element.probes.readiness | object | `{}` | |
438440
| element.probes.startup | object | `{}` | |
@@ -798,6 +800,8 @@ A Helm chart to deploy a Matrix homeserver stack on Kubernetes
798800
| synapse.metrics.enabled | bool | `true` | Whether Synapse should capture metrics on an additional endpoint |
799801
| synapse.metrics.port | int | `9092` | Port to listen on for metrics scraping |
800802
| synapse.metrics.serviceMonitor.enabled | bool | `false` | enable a prometheus ServiceMonitor to send metrics to prometheus |
803+
| synapse.podAnnotations | object | `{}` | |
804+
| synapse.podLabels | object | `{}` | |
801805
| synapse.podSecurityContext | object | `{"env":false,"fsGroup":1000,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000}` | securityContext for the entire synapse pod, including the all containers Does not work by default in all cloud providers, disable by default |
802806
| synapse.podSecurityContext.env | bool | `false` | Enable if your k8s environment allows containers to chuser/setuid https://github.com/matrix-org/synapse/blob/96cf81e312407f0caba1b45ba9899906b1dcc098/docker/start.py#L196 |
803807
| synapse.podSecurityContext.fsGroup | int | `1000` | A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows. |

charts/matrix/templates/element/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ spec:
1818
annotations:
1919
# re-roll deployment on config change
2020
checksum/element-config: {{ include (print $.Template.BasePath "/element/configmap.yaml") . | sha256sum }}
21+
{{- with .Values.element.podAnnotations }}
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
2124
labels:
2225
app.kubernetes.io/name: {{ include "matrix.name" . }}-element
2326
app.kubernetes.io/instance: {{ .Release.Name }}
27+
{{- with .Values.element.podLabels }}
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
2430
spec:
2531
{{- with .Values.imagePullSecrets }}
2632
imagePullSecrets:

charts/matrix/templates/synapse/deployment.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ spec:
1919
labels:
2020
app.kubernetes.io/name: {{ include "matrix.name" . }}-synapse
2121
app.kubernetes.io/instance: {{ .Release.Name }}
22+
{{- with .Values.synapse.podLabels }}
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
2225
{{- if and (not .Values.bridges.hookshot.existingSecret.registration) (not .Values.matrix.homeserverOverride) }}
2326
annotations:
2427
# re-roll deployment on config change
@@ -34,6 +37,14 @@ spec:
3437
{{- if not .Values.matrix.homeserverOverride }}
3538
checksum/synapse-config: {{ include (print $.Template.BasePath "/synapse/initial-config-map.yaml") . | sha256sum }}
3639
{{- end }}
40+
{{- with .Values.synapse.podAnnotations }}
41+
{{- toYaml . | nindent 8 }}
42+
{{- end }}
43+
{{- else }}
44+
{{- with .Values.synapse.podAnnotations }}
45+
annotations:
46+
{{- toYaml . | nindent 8 }}
47+
{{- end }}
3748
{{- end }}
3849
spec:
3950
{{- with .Values.imagePullSecrets }}

charts/matrix/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,8 @@ synapse:
762762
# -- Labels to be appended to all Synapse resources
763763
labels:
764764
component: synapse
765+
podAnnotations: {}
766+
podLabels: {}
765767

766768
# Prometheus metrics for Synapse
767769
# https://github.com/element-hq/synapse/blob/develop/docs/metrics-howto.md
@@ -1458,6 +1460,8 @@ element:
14581460
# -- Element specific labels
14591461
labels:
14601462
component: element
1463+
podAnnotations: {}
1464+
podLabels: {}
14611465

14621466
# Settings for Coturn TURN relay, used for routing voice calls
14631467
coturn:

0 commit comments

Comments
 (0)