diff --git a/charts/matrix-stack/source/deployment-markers.json b/charts/matrix-stack/source/deployment-markers.json index 5c085a7f..237a7ad9 100644 --- a/charts/matrix-stack/source/deployment-markers.json +++ b/charts/matrix-stack/source/deployment-markers.json @@ -23,6 +23,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "containersSecurityContext": { "$ref": "file://common/containersSecurityContext.json" }, diff --git a/charts/matrix-stack/source/deployment-markers.yaml.j2 b/charts/matrix-stack/source/deployment-markers.yaml.j2 index d6eaebfb..7c2bac97 100644 --- a/charts/matrix-stack/source/deployment-markers.yaml.j2 +++ b/charts/matrix-stack/source/deployment-markers.yaml.j2 @@ -15,6 +15,7 @@ rbac: {{- sub_schema_values.workloadAnnotations() -}} {{- sub_schema_values.containersSecurityContext() -}} {{- sub_schema_values.extraEnv() -}} +{{- sub_schema_values.extraVolumesAndMounts("Deployment Markers") }} {{- sub_schema_values.nodeSelector() -}} {{- sub_schema_values.podSecurityContext(user_id='10010', group_id='10010') -}} {{- sub_schema_values.resources(requests_memory='50Mi', requests_cpu='50m', limits_memory='200Mi') -}} diff --git a/charts/matrix-stack/source/element-admin.json b/charts/matrix-stack/source/element-admin.json index 27241b7e..c2a23a04 100644 --- a/charts/matrix-stack/source/element-admin.json +++ b/charts/matrix-stack/source/element-admin.json @@ -19,6 +19,12 @@ "labels": { "$ref": "file://common/labels.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "annotations": { "$ref": "file://common/workloadAnnotations.json" }, diff --git a/charts/matrix-stack/source/element-admin.yaml.j2 b/charts/matrix-stack/source/element-admin.yaml.j2 index 962443ca..cf249878 100644 --- a/charts/matrix-stack/source/element-admin.yaml.j2 +++ b/charts/matrix-stack/source/element-admin.yaml.j2 @@ -17,6 +17,7 @@ replicas: 1 {{- sub_schema_values.labels() -}} {{- sub_schema_values.workloadAnnotations() -}} {{- sub_schema_values.extraEnv() -}} +{{- sub_schema_values.extraVolumesAndMounts("Element Admin") }} {{- sub_schema_values.containersSecurityContext() -}} {{- sub_schema_values.nodeSelector() -}} {{- sub_schema_values.podSecurityContext(user_id='10104', group_id='10104') -}} diff --git a/charts/matrix-stack/source/haproxy.json b/charts/matrix-stack/source/haproxy.json index a8d34715..ebdda2f4 100644 --- a/charts/matrix-stack/source/haproxy.json +++ b/charts/matrix-stack/source/haproxy.json @@ -19,6 +19,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "containersSecurityContext": { "$ref": "file://common/containersSecurityContext.json" }, diff --git a/charts/matrix-stack/source/haproxy.yaml.j2 b/charts/matrix-stack/source/haproxy.yaml.j2 index 6d6f3f65..c438c2f1 100644 --- a/charts/matrix-stack/source/haproxy.yaml.j2 +++ b/charts/matrix-stack/source/haproxy.yaml.j2 @@ -13,6 +13,7 @@ replicas: 1 {{- sub_schema_values.workloadAnnotations() }} {{- sub_schema_values.containersSecurityContext() }} {{- sub_schema_values.extraEnv() }} +{{- sub_schema_values.extraVolumesAndMounts("HAProxy") }} {{- sub_schema_values.nodeSelector() }} {{- sub_schema_values.podSecurityContext(user_id='10001', group_id='10001') }} {{- sub_schema_values.resources(requests_memory='100Mi', requests_cpu='100m', limits_memory='200Mi') }} diff --git a/charts/matrix-stack/source/init-secrets.json b/charts/matrix-stack/source/init-secrets.json index 8854e0d6..ba525ad0 100644 --- a/charts/matrix-stack/source/init-secrets.json +++ b/charts/matrix-stack/source/init-secrets.json @@ -23,6 +23,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "containersSecurityContext": { "$ref": "file://common/containersSecurityContext.json" }, diff --git a/charts/matrix-stack/source/init-secrets.yaml.j2 b/charts/matrix-stack/source/init-secrets.yaml.j2 index 9c87966c..fe593be0 100644 --- a/charts/matrix-stack/source/init-secrets.yaml.j2 +++ b/charts/matrix-stack/source/init-secrets.yaml.j2 @@ -15,6 +15,7 @@ rbac: {{- sub_schema_values.workloadAnnotations() -}} {{- sub_schema_values.containersSecurityContext() -}} {{- sub_schema_values.extraEnv() -}} +{{- sub_schema_values.extraVolumesAndMounts("Init Secrets") }} {{- sub_schema_values.nodeSelector() -}} {{- sub_schema_values.podSecurityContext(user_id='10010', group_id='10010') -}} {{- sub_schema_values.resources(requests_memory='50Mi', requests_cpu='50m', limits_memory='200Mi') -}} diff --git a/charts/matrix-stack/source/matrix-rtc.json b/charts/matrix-stack/source/matrix-rtc.json index eba73e70..bdf936fb 100644 --- a/charts/matrix-stack/source/matrix-rtc.json +++ b/charts/matrix-stack/source/matrix-rtc.json @@ -53,6 +53,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "image": { "$ref": "file://common/image.json" }, @@ -116,6 +122,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "annotations": { "$ref": "file://common/workloadAnnotations.json" }, diff --git a/charts/matrix-stack/source/matrix-rtc.yaml.j2 b/charts/matrix-stack/source/matrix-rtc.yaml.j2 index 7d5804bc..291e0f20 100644 --- a/charts/matrix-stack/source/matrix-rtc.yaml.j2 +++ b/charts/matrix-stack/source/matrix-rtc.yaml.j2 @@ -30,6 +30,7 @@ replicas: 1 {{- sub_schema_values.containersSecurityContext() }} {{- sub_schema_values.hostAliases() }} {{- sub_schema_values.extraEnv() }} +{{- sub_schema_values.extraVolumesAndMounts("Matrix RTC") }} {{- sub_schema_values.nodeSelector() }} {{- sub_schema_values.podSecurityContext(user_id='10033', group_id='10033') }} {{- sub_schema_values.resources(requests_memory='20Mi', requests_cpu='50m', limits_memory='20Mi') }} @@ -75,6 +76,7 @@ sfu: {{- sub_schema_values.image(registry='docker.io', repository='livekit/livekit-server', tag='v1.9.1') | indent(2) }} {{- sub_schema_values.extraEnv() | indent(2) }} +{{- sub_schema_values.extraVolumesAndMounts("Matrix RTC SFU") | indent(2) }} {{- sub_schema_values.labels() | indent(2) }} {{- sub_schema_values.workloadAnnotations() | indent(2) }} {{- sub_schema_values.containersSecurityContext() | indent(2) }} diff --git a/charts/matrix-stack/source/matrixAuthenticationService.json b/charts/matrix-stack/source/matrixAuthenticationService.json index b01f402c..9cf6b567 100644 --- a/charts/matrix-stack/source/matrixAuthenticationService.json +++ b/charts/matrix-stack/source/matrixAuthenticationService.json @@ -64,6 +64,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "containersSecurityContext": { "$ref": "file://common/containersSecurityContext.json" }, @@ -105,6 +111,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "hostAliases": { "$ref": "file://common/hostAliases.json" }, diff --git a/charts/matrix-stack/source/matrixAuthenticationService.yaml.j2 b/charts/matrix-stack/source/matrixAuthenticationService.yaml.j2 index 596d5529..3ef4f842 100644 --- a/charts/matrix-stack/source/matrixAuthenticationService.yaml.j2 +++ b/charts/matrix-stack/source/matrixAuthenticationService.yaml.j2 @@ -39,6 +39,7 @@ privateKeys: {{ sub_schema_values.workloadAnnotations() }} {{ sub_schema_values.serviceMonitors() }} {{ sub_schema_values.extraEnv() }} +{{ sub_schema_values.extraVolumesAndMounts("Matrix Authentication Service") }} {{ sub_schema_values.probe("liveness") }} {{ sub_schema_values.probe("readiness") }} {{ sub_schema_values.probe("startup", failureThreshold=4) }} @@ -69,6 +70,7 @@ syn2mas: {{- sub_schema_values.resources(requests_memory='50Mi', requests_cpu='50m', limits_memory='350Mi') | indent(2) -}} {{- sub_schema_values.serviceAccount() | indent(2) -}} {{- sub_schema_values.extraEnv() | indent(2) -}} + {{- sub_schema_values.extraVolumesAndMounts("Syn2Mas") | indent(2) -}} {{- sub_schema_values.tolerations() | indent(2) }} {{- sub_schema_values.topologySpreadConstraints() | indent(2) }} diff --git a/charts/matrix-stack/source/postgres.json b/charts/matrix-stack/source/postgres.json index d74c1d6e..3f5054de 100644 --- a/charts/matrix-stack/source/postgres.json +++ b/charts/matrix-stack/source/postgres.json @@ -18,6 +18,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "containersSecurityContext": { "$ref": "file://common/containersSecurityContext.json" }, @@ -61,6 +67,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "containersSecurityContext": { "$ref": "file://common/containersSecurityContext.json" }, diff --git a/charts/matrix-stack/source/postgres.yaml.j2 b/charts/matrix-stack/source/postgres.yaml.j2 index 79cbb8a5..f632bf59 100644 --- a/charts/matrix-stack/source/postgres.yaml.j2 +++ b/charts/matrix-stack/source/postgres.yaml.j2 @@ -11,6 +11,7 @@ postgresExporter: {{- sub_schema_values.resources(requests_memory='10Mi', requests_cpu='10m', limits_memory='500Mi')| indent(2) }} {{- sub_schema_values.containersSecurityContext() | indent(2) }} {{- sub_schema_values.extraEnv() | indent(2) }} + {{- sub_schema_values.extraVolumesAndMounts("Postgres Exporter") | indent(2) }} {{- sub_schema_values.probe("liveness", periodSeconds=6, timeoutSeconds=2) | indent(2) }} {{- sub_schema_values.probe("readiness", periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }} {{- sub_schema_values.probe("startup", failureThreshold=20, periodSeconds=2) | indent(2) }} @@ -24,6 +25,7 @@ essPasswords: {{- sub_schema_values.persistentVolumeClaim("storage") }} {{- sub_schema_values.image(registry='docker.io', repository='postgres', tag='17-alpine') }} {{- sub_schema_values.extraEnv() }} +{{- sub_schema_values.extraVolumesAndMounts("Postgres") }} {{- sub_schema_values.labels() }} {{- sub_schema_values.workloadAnnotations() }} {{- sub_schema_values.containersSecurityContext() }} diff --git a/charts/matrix-stack/source/synapse.json b/charts/matrix-stack/source/synapse.json index b1d7bf89..7b855767 100644 --- a/charts/matrix-stack/source/synapse.json +++ b/charts/matrix-stack/source/synapse.json @@ -273,6 +273,12 @@ "extraEnv": { "$ref": "file://common/extraEnv.json" }, + "extraVolumes": { + "$ref": "file://common/extraVolumes.json" + }, + "extraVolumeMounts": { + "$ref": "file://common/extraVolumeMounts.json" + }, "containersSecurityContext": { "$ref": "file://common/containersSecurityContext.json" }, diff --git a/charts/matrix-stack/source/synapse.yaml.j2 b/charts/matrix-stack/source/synapse.yaml.j2 index 58474522..0698abd3 100644 --- a/charts/matrix-stack/source/synapse.yaml.j2 +++ b/charts/matrix-stack/source/synapse.yaml.j2 @@ -113,6 +113,7 @@ redis: {{- sub_schema_values.workloadAnnotations() | indent(2) }} {{- sub_schema_values.containersSecurityContext() | indent(2) }} {{- sub_schema_values.extraEnv() | indent(2) }} +{{- sub_schema_values.extraVolumesAndMounts("Redis") | indent(2) }} {{- sub_schema_values.nodeSelector() | indent(2) }} {{- sub_schema_values.podSecurityContext(user_id='10002', group_id='10002') | indent(2) }} {{- sub_schema_values.resources(requests_memory='50Mi', requests_cpu='50m', limits_memory='50Mi') | indent(2) }} diff --git a/charts/matrix-stack/values.schema.json b/charts/matrix-stack/values.schema.json index 0093d384..bebf665e 100644 --- a/charts/matrix-stack/values.schema.json +++ b/charts/matrix-stack/values.schema.json @@ -382,6 +382,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "containersSecurityContext": { "properties": { "allowPrivilegeEscalation": { @@ -739,6 +793,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "containersSecurityContext": { "properties": { "allowPrivilegeEscalation": { @@ -1141,6 +1249,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "image": { "type": "object", "required": [ @@ -1840,6 +2002,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "annotations": { "type": "object", "additionalProperties": { @@ -2588,6 +2804,60 @@ ] } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "annotations": { "type": "object", "additionalProperties": { @@ -3817,6 +4087,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "containersSecurityContext": { "properties": { "allowPrivilegeEscalation": { @@ -4579,6 +4903,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "containersSecurityContext": { "properties": { "allowPrivilegeEscalation": { @@ -5088,6 +5466,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "hostAliases": { "type": "array", "items": { @@ -5677,6 +6109,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "containersSecurityContext": { "properties": { "allowPrivilegeEscalation": { @@ -5991,6 +6477,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "containersSecurityContext": { "properties": { "allowPrivilegeEscalation": { @@ -12576,6 +13116,60 @@ "additionalProperties": false } }, + "extraVolumes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + } + } + } + }, + "extraVolumeMounts": { + "type": "array", + "items": { + "required": [ + "name", + "mountPath" + ], + "type": "object", + "description": "VolumeMount describes a mounting of a Volume within a container.", + "properties": { + "readOnly": { + "type": "boolean", + "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." + }, + "mountPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the container at which the volume should be mounted. Must not contain ':'." + }, + "subPath": { + "type": [ + "string", + "null" + ], + "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "This must match the Name of a Volume." + } + }, + "additionalProperties": false + } + }, "containersSecurityContext": { "properties": { "allowPrivilegeEscalation": { diff --git a/charts/matrix-stack/values.yaml b/charts/matrix-stack/values.yaml index 08e08e4e..4d4d9763 100644 --- a/charts/matrix-stack/values.yaml +++ b/charts/matrix-stack/values.yaml @@ -169,6 +169,13 @@ initSecrets: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Init Secrets, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Init Secrets, as a yaml array + extraVolumeMounts: [] + ## NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ nodeSelector: {} ## A subset of PodSecurityContext. PodSecurityContext holds pod-level security attributes and common container settings @@ -309,6 +316,13 @@ deploymentMarkers: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Deployment Markers, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Deployment Markers, as a yaml array + extraVolumeMounts: [] + ## NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ nodeSelector: {} ## A subset of PodSecurityContext. PodSecurityContext holds pod-level security attributes and common container settings @@ -541,6 +555,13 @@ matrixRTC: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Matrix RTC, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Matrix RTC, as a yaml array + extraVolumeMounts: [] + ## NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ nodeSelector: {} ## A subset of PodSecurityContext. PodSecurityContext holds pod-level security attributes and common container settings @@ -785,6 +806,13 @@ matrixRTC: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Matrix RTC SFU, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Matrix RTC SFU, as a yaml array + extraVolumeMounts: [] + ## Labels to add to all manifest for this component labels: {} ## Defines the annotations to add to the workload @@ -1029,6 +1057,13 @@ elementAdmin: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Element Admin, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Element Admin, as a yaml array + extraVolumeMounts: [] + ## A subset of SecurityContext. ContainersSecurityContext holds pod-level security attributes and common container settings containersSecurityContext: ## Controls whether a process can gain more privileges than its parent process. @@ -1513,6 +1548,13 @@ haproxy: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in HAProxy, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in HAProxy, as a yaml array + extraVolumeMounts: [] + ## NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ nodeSelector: {} ## A subset of PodSecurityContext. PodSecurityContext holds pod-level security attributes and common container settings @@ -2009,6 +2051,14 @@ matrixAuthenticationService: ## value: "bar" extraEnv: [] + # Extra volumes to mount in Matrix Authentication Service, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Matrix Authentication Service, as a yaml array + extraVolumeMounts: [] + + ## Configuration of the thresholds and frequencies of the livenessProbe livenessProbe: ## How many consecutive failures for the probe to be considered failed @@ -2208,6 +2258,13 @@ matrixAuthenticationService: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Syn2Mas, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Syn2Mas, as a yaml array + extraVolumeMounts: [] + ## Workload tolerations allows Pods that are part of this (sub)component to 'tolerate' any taint that matches the triple using the matching operator . ## ## * effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. @@ -2313,6 +2370,13 @@ postgres: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Postgres Exporter, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Postgres Exporter, as a yaml array + extraVolumeMounts: [] + ## Configuration of the thresholds and frequencies of the livenessProbe livenessProbe: ## How many consecutive failures for the probe to be considered failed @@ -2449,6 +2513,13 @@ postgres: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Postgres, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Postgres, as a yaml array + extraVolumeMounts: [] + ## Labels to add to all manifest for this component labels: {} ## Defines the annotations to add to the workload @@ -4355,6 +4426,13 @@ synapse: ## - name: FOO ## value: "bar" extraEnv: [] + # Extra volumes to mount in Redis, as a yaml array + # This supports helm templating + extraVolumes: [] + + # Extra volumes to mount in Redis, as a yaml array + extraVolumeMounts: [] + ## NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ nodeSelector: {} ## A subset of PodSecurityContext. PodSecurityContext holds pod-level security attributes and common container settings diff --git a/tests/manifests/__init__.py b/tests/manifests/__init__.py index d8da48d2..cfefd385 100644 --- a/tests/manifests/__init__.py +++ b/tests/manifests/__init__.py @@ -13,6 +13,8 @@ class PropertyType(Enum): AdditionalConfig = "additional" Enabled = "enabled" Env = "extraEnv" + Volumes = "extraVolumes" + VolumeMounts = "extraVolumeMounts" HostAliases = "hostAliases" Image = "image" Ingress = "ingress" @@ -357,6 +359,8 @@ def make_synapse_worker_sub_component(worker_name: str, worker_type: str) -> Sub values_file_path_overrides: dict[PropertyType, ValuesFilePath] = { PropertyType.AdditionalConfig: ValuesFilePath.read_elsewhere("synapse", "additional"), PropertyType.Env: ValuesFilePath.read_elsewhere("synapse", "extraEnv"), + PropertyType.Volumes: ValuesFilePath.read_elsewhere("synapse", "extraVolumes"), + PropertyType.VolumeMounts: ValuesFilePath.read_elsewhere("synapse", "extraVolumeMounts"), PropertyType.HostAliases: ValuesFilePath.read_elsewhere("synapse", "hostAliases"), PropertyType.Image: ValuesFilePath.read_elsewhere("synapse", "image"), PropertyType.Labels: ValuesFilePath.read_elsewhere("synapse", "labels"), @@ -641,6 +645,8 @@ all_components_details = [ values_file_path_overrides={ PropertyType.AdditionalConfig: ValuesFilePath.read_elsewhere("synapse", "additional"), PropertyType.Env: ValuesFilePath.read_elsewhere("synapse", "extraEnv"), + PropertyType.Volumes: ValuesFilePath.read_elsewhere("synapse", "extraVolumes"), + PropertyType.VolumeMounts: ValuesFilePath.read_elsewhere("synapse", "extraVolumeMounts"), PropertyType.Image: ValuesFilePath.read_elsewhere("synapse", "image"), # Job so no livenessProbe PropertyType.LivenessProbe: ValuesFilePath.not_supported(), diff --git a/tests/manifests/test_volumes.py b/tests/manifests/test_volumes.py index 592ad0ff..f8c0a1d0 100644 --- a/tests/manifests/test_volumes.py +++ b/tests/manifests/test_volumes.py @@ -5,9 +5,15 @@ import pytest +from frozendict import deepfreeze -from . import secret_values_files_to_test, values_files_to_test -from .utils import template_id +from . import ( + DeployableDetails, + PropertyType, + secret_values_files_to_test, + values_files_to_test, +) +from .utils import iterate_deployables_workload_parts, template_id @pytest.mark.parametrize("values_file", values_files_to_test | secret_values_files_to_test) @@ -27,3 +33,46 @@ async def test_emptyDirs_are_memory(templates): assert volume["emptyDir"]["medium"] == "Memory", ( f"{template_id(template)} has emptyDir {volume['name']} that isn't Memory backed" ) + + +@pytest.mark.parametrize("values_file", values_files_to_test) +@pytest.mark.asyncio_cooperative +async def test_extra_volumes(values, make_templates): + extra_volumes = deepfreeze( + [ + { + "name": "extra-volume", + "emptyDir": {}, + }, + ] + ) + + def set_extra_volumes(deployable_details: DeployableDetails): + deployable_details.set_helm_values( + values, + PropertyType.Volumes, + extra_volumes, + ) + + template_id_to_pod_volumes = {} + for template in await make_templates(values): + if template["kind"] in ["Deployment", "StatefulSet", "Job"]: + assert "volumes" in template["spec"]["template"]["spec"], ( + f"Pod volumes unexpectedly absent for {template_id(template)}" + ) + + pod_volumes = deepfreeze(template["spec"]["template"]["spec"]["volumes"]) + template_id_to_pod_volumes[template_id(template)] = pod_volumes + + iterate_deployables_workload_parts(set_extra_volumes) + + for template in await make_templates(values): + if template["kind"] in ["Deployment", "StatefulSet", "Job"]: + assert "volumes" in template["spec"]["template"]["spec"], ( + f"Pod volumes unexpectedly absent for {template_id(template)}" + ) + + pod_volumes = deepfreeze(template["spec"]["template"]["spec"]["volumes"]) + assert set(pod_volumes) - set(template_id_to_pod_volumes[template_id(template)]) == set(extra_volumes), ( + f"Pod volumes {pod_volumes} is missing expected extra volume" + ) diff --git a/tests/manifests/test_volumes_mounts.py b/tests/manifests/test_volumes_mounts.py index 5e398e28..b609a206 100644 --- a/tests/manifests/test_volumes_mounts.py +++ b/tests/manifests/test_volumes_mounts.py @@ -6,9 +6,15 @@ import re import pytest +from frozendict import deepfreeze -from . import secret_values_files_to_test, values_files_to_test -from .utils import template_id, workload_spec_containers +from . import ( + DeployableDetails, + PropertyType, + secret_values_files_to_test, + values_files_to_test, +) +from .utils import iterate_deployables_workload_parts, template_id, workload_spec_containers @pytest.mark.parametrize("values_file", values_files_to_test | secret_values_files_to_test) @@ -63,3 +69,46 @@ async def test_volumes_mounts_exists(release_name, templates, other_secrets, oth f"Volume Mount {volume_mount['name']} not found in volume names: {volumes_names} " f"for {template_id(template)}/{container['name']}" ) + + +@pytest.mark.parametrize("values_file", values_files_to_test) +@pytest.mark.asyncio_cooperative +async def test_extra_volume_mounts(values, make_templates): + extra_volume_mounts = set( + deepfreeze( + [ + { + "name": "extra-volume", + "path": "/extra-volume", + }, + ] + ) + ) + + def set_extra_volume_mounts(deployable_details: DeployableDetails): + deployable_details.set_helm_values( + values, + PropertyType.VolumeMounts, + extra_volume_mounts, + ) + + template_containers_volumes_mounts = {} + for template in await make_templates(values): + if template["kind"] in ["Deployment", "StatefulSet", "Job"]: + for container in template["spec"]["template"]["spec"].get("containers", []): + volumes_mounts = deepfreeze(container.get("volumeMounts", [])) + pod_container_volumes = volumes_mounts + template_containers_volumes_mounts[f"{template_id(template)}/{container['name']}"] = ( + pod_container_volumes + ) + + iterate_deployables_workload_parts(set_extra_volume_mounts) + + for template in await make_templates(values): + if template["kind"] in ["Deployment", "StatefulSet", "Job"]: + for container in template["spec"]["template"]["spec"].get("containers", []): + volumes_mounts = deepfreeze(container.get("volumeMounts", [])) + assert set(volumes_mounts) - set(template_containers_volumes_mounts[template_id(template)]) == set( + extra_volume_mounts + ), f"Pod container {template_id(template) / container['name']} volume mounts {volumes_mounts}" + " is missing expected extra volume"