mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-11-26 11:56:37 -08:00
Merge pull request #965 from element-hq/gaelg/postgres-exporter-volume-mounts
postgres-exporter: support extra volume mounts
This commit is contained in:
17 files changed
+102
-17
No files matched your search
@@ -439,7 +439,7 @@ networking:
|
||||
{{ key }}: {}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro extraVolumesAndMounts(component, with_context=False) %}
|
||||
{% macro extraVolumes(component, with_context=False) %}
|
||||
# Extra volumes to mount in {{ component }}, as a yaml array
|
||||
# This supports helm templating
|
||||
{%- if with_context %}
|
||||
@@ -448,7 +448,9 @@ networking:
|
||||
# Defaults to "both".
|
||||
{%- endif %}
|
||||
extraVolumes: []
|
||||
{% endmacro %}
|
||||
|
||||
{% macro extraVolumeMounts(component, with_context=False) %}
|
||||
# Extra volumes to mount in {{ component }}, as a yaml array
|
||||
{%- if with_context %}
|
||||
# For each extra volume mount, specify `mountContext` to `hook`, `runtime` or `both` to specify
|
||||
|
||||
@@ -15,7 +15,8 @@ rbac:
|
||||
{{- sub_schema_values.workloadAnnotations() -}}
|
||||
{{- sub_schema_values.containersSecurityContext() -}}
|
||||
{{- sub_schema_values.extraEnv() -}}
|
||||
{{- sub_schema_values.extraVolumesAndMounts("Deployment Markers") }}
|
||||
{{- sub_schema_values.extraVolumes("Deployment Markers") }}
|
||||
{{- sub_schema_values.extraVolumeMounts("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') -}}
|
||||
|
||||
@@ -17,7 +17,8 @@ replicas: 1
|
||||
{{- sub_schema_values.labels() -}}
|
||||
{{- sub_schema_values.workloadAnnotations() -}}
|
||||
{{- sub_schema_values.extraEnv() -}}
|
||||
{{- sub_schema_values.extraVolumesAndMounts("Element Admin") }}
|
||||
{{- sub_schema_values.extraVolumes("Element Admin") }}
|
||||
{{- sub_schema_values.extraVolumeMounts("Element Admin") }}
|
||||
{{- sub_schema_values.containersSecurityContext() -}}
|
||||
{{- sub_schema_values.nodeSelector() -}}
|
||||
{{- sub_schema_values.podSecurityContext(user_id='10104', group_id='10104') -}}
|
||||
|
||||
@@ -17,7 +17,8 @@ enabled: true
|
||||
## Most settings are configurable but some settings are owned by the chart and can't be overwritten
|
||||
additional: {}
|
||||
|
||||
{{- sub_schema_values.extraVolumesAndMounts("ElementWeb") }}
|
||||
{{- sub_schema_values.extraVolumes("Element Web") }}
|
||||
{{- sub_schema_values.extraVolumeMounts("Element Web") }}
|
||||
|
||||
# Number of Element Web replicas to start up
|
||||
replicas: 1
|
||||
|
||||
@@ -13,7 +13,8 @@ replicas: 1
|
||||
{{- sub_schema_values.workloadAnnotations() }}
|
||||
{{- sub_schema_values.containersSecurityContext() }}
|
||||
{{- sub_schema_values.extraEnv() }}
|
||||
{{- sub_schema_values.extraVolumesAndMounts("HAProxy") }}
|
||||
{{- sub_schema_values.extraVolumes("HAProxy") }}
|
||||
{{- sub_schema_values.extraVolumeMounts("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') }}
|
||||
|
||||
@@ -15,7 +15,8 @@ rbac:
|
||||
{{- sub_schema_values.workloadAnnotations() -}}
|
||||
{{- sub_schema_values.containersSecurityContext() -}}
|
||||
{{- sub_schema_values.extraEnv() -}}
|
||||
{{- sub_schema_values.extraVolumesAndMounts("Init Secrets") }}
|
||||
{{- sub_schema_values.extraVolumes("Init Secrets") }}
|
||||
{{- sub_schema_values.extraVolumeMounts("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') -}}
|
||||
|
||||
@@ -30,7 +30,8 @@ replicas: 1
|
||||
{{- sub_schema_values.containersSecurityContext() }}
|
||||
{{- sub_schema_values.hostAliases() }}
|
||||
{{- sub_schema_values.extraEnv() }}
|
||||
{{- sub_schema_values.extraVolumesAndMounts("Matrix RTC") }}
|
||||
{{- sub_schema_values.extraVolumes("Matrix RTC") }}
|
||||
{{- sub_schema_values.extraVolumeMounts("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') }}
|
||||
@@ -76,7 +77,8 @@ 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.extraVolumes("Matrix RTC SFU") | indent(2) }}
|
||||
{{- sub_schema_values.extraVolumeMounts("Matrix RTC SFU") | indent(2) }}
|
||||
{{- sub_schema_values.labels() | indent(2) }}
|
||||
{{- sub_schema_values.workloadAnnotations() | indent(2) }}
|
||||
{{- sub_schema_values.containersSecurityContext() | indent(2) }}
|
||||
|
||||
@@ -39,7 +39,8 @@ privateKeys:
|
||||
{{ sub_schema_values.workloadAnnotations() }}
|
||||
{{ sub_schema_values.serviceMonitors() }}
|
||||
{{ sub_schema_values.extraEnv() }}
|
||||
{{ sub_schema_values.extraVolumesAndMounts("Matrix Authentication Service") }}
|
||||
{{ sub_schema_values.extraVolumes("Matrix Authentication Service") }}
|
||||
{{ sub_schema_values.extraVolumeMounts("Matrix Authentication Service") }}
|
||||
{{ sub_schema_values.probe("liveness") }}
|
||||
{{ sub_schema_values.probe("readiness") }}
|
||||
{{ sub_schema_values.probe("startup", failureThreshold=4) }}
|
||||
@@ -70,7 +71,8 @@ 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.extraVolumes("Syn2Mas") | indent(2) -}}
|
||||
{{- sub_schema_values.extraVolumeMounts("Syn2Mas") | indent(2) -}}
|
||||
{{- sub_schema_values.tolerations() | indent(2) }}
|
||||
{{- sub_schema_values.topologySpreadConstraints() | indent(2) }}
|
||||
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
"resources": {
|
||||
"$ref": "file://common/resources.json"
|
||||
},
|
||||
"extraVolumes": {
|
||||
"$ref": "file://common/extraVolumes.json"
|
||||
},
|
||||
"extraVolumeMounts": {
|
||||
"$ref": "file://common/extraVolumeMounts.json"
|
||||
},
|
||||
"livenessProbe": {
|
||||
"$ref": "file://common/probe.json"
|
||||
},
|
||||
|
||||
@@ -9,6 +9,7 @@ enabled: true
|
||||
postgresExporter:
|
||||
{{- sub_schema_values.image(registry='docker.io', repository='prometheuscommunity/postgres-exporter', tag='v0.18.1') | indent(2) }}
|
||||
{{- sub_schema_values.resources(requests_memory='10Mi', requests_cpu='10m', limits_memory='500Mi')| indent(2) }}
|
||||
{{- sub_schema_values.extraVolumeMounts("PostgresExporter") | indent(2) }}
|
||||
{{- sub_schema_values.containersSecurityContext() | indent(2) }}
|
||||
{{- sub_schema_values.extraEnv() | indent(2) }}
|
||||
{{- sub_schema_values.probe("liveness", periodSeconds=6, timeoutSeconds=2) | indent(2) }}
|
||||
@@ -24,7 +25,8 @@ 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.extraVolumes("Postgres") }}
|
||||
{{- sub_schema_values.extraVolumeMounts("Postgres") }}
|
||||
{{- sub_schema_values.labels() }}
|
||||
{{- sub_schema_values.workloadAnnotations() }}
|
||||
{{- sub_schema_values.containersSecurityContext() }}
|
||||
|
||||
@@ -86,7 +86,8 @@ logging:
|
||||
## synapse.util.caches.lrucache: WARNING
|
||||
levelOverrides: {}
|
||||
{{- sub_schema_values.image(registry='oci.element.io', repository='synapse', tag='v1.144.0-ess.2') }}
|
||||
{{- sub_schema_values.extraVolumesAndMounts("Synapse", with_context=true) }}
|
||||
{{- sub_schema_values.extraVolumes("Synapse", with_context=true) }}
|
||||
{{- sub_schema_values.extraVolumeMounts("Synapse", with_context=true) }}
|
||||
{{- sub_schema_values.ingress() }}
|
||||
{{- sub_schema_values.labels() }}
|
||||
{{- sub_schema_values.workloadAnnotations() }}
|
||||
@@ -113,7 +114,8 @@ 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.extraVolumes("Redis") | indent(2) }}
|
||||
{{- sub_schema_values.extraVolumeMounts("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) }}
|
||||
|
||||
@@ -6190,6 +6190,60 @@
|
||||
"type": "object",
|
||||
"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
|
||||
}
|
||||
},
|
||||
"livenessProbe": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1246,11 +1246,11 @@ elementWeb:
|
||||
## Full details on available configuration options can be found at https://github.com/element-hq/element-web/blob/develop/docs/config.md
|
||||
## Most settings are configurable but some settings are owned by the chart and can't be overwritten
|
||||
additional: {}
|
||||
# Extra volumes to mount in ElementWeb, as a yaml array
|
||||
# Extra volumes to mount in Element Web, as a yaml array
|
||||
# This supports helm templating
|
||||
extraVolumes: []
|
||||
|
||||
# Extra volumes to mount in ElementWeb, as a yaml array
|
||||
# Extra volumes to mount in Element Web, as a yaml array
|
||||
extraVolumeMounts: []
|
||||
|
||||
|
||||
@@ -2055,6 +2055,7 @@ matrixAuthenticationService:
|
||||
# This supports helm templating
|
||||
extraVolumes: []
|
||||
|
||||
|
||||
# Extra volumes to mount in Matrix Authentication Service, as a yaml array
|
||||
extraVolumeMounts: []
|
||||
|
||||
@@ -2341,6 +2342,9 @@ postgres:
|
||||
## Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
||||
limits:
|
||||
memory: 500Mi
|
||||
# Extra volumes to mount in PostgresExporter, 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.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Add support for `extraVolumes` and `extraVolumeMounts` in components values.
|
||||
@@ -241,7 +241,6 @@ class SidecarDetails(DeployableDetails):
|
||||
PropertyType.PodSecurityContext: ValuesFilePath.not_supported(),
|
||||
PropertyType.ServiceAccount: ValuesFilePath.not_supported(),
|
||||
PropertyType.Volumes: ValuesFilePath.not_supported(),
|
||||
PropertyType.VolumeMounts: ValuesFilePath.not_supported(),
|
||||
PropertyType.Tolerations: ValuesFilePath.not_supported(),
|
||||
PropertyType.TopologySpreadConstraints: ValuesFilePath.not_supported(),
|
||||
}
|
||||
|
||||
@@ -129,6 +129,9 @@ async def test_extra_volumes(values, make_templates, release_name):
|
||||
|
||||
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"])
|
||||
deployable_details = template_to_deployable_details(template)
|
||||
if deployable_details.has_mount_context:
|
||||
|
||||
@@ -174,7 +174,10 @@ async def test_extra_volume_mounts(values, make_templates):
|
||||
for template in await make_templates(values):
|
||||
if template["kind"] in ["Deployment", "StatefulSet", "Job"]:
|
||||
for container in workload_spec_containers(template["spec"]["template"]["spec"]):
|
||||
volumes_mounts = deepfreeze(container.get("volumeMounts", []))
|
||||
assert "volumeMounts" in container, (
|
||||
f"Pod container {template_id(template)}/{container['name']} does not have volumeMounts"
|
||||
)
|
||||
volumes_mounts = deepfreeze(container["volumeMounts"])
|
||||
deployable_details = template_to_deployable_details(template)
|
||||
container_details = deployable_details.deployable_details_for_container(container["name"])
|
||||
if container_details.has_mount_context:
|
||||
|
||||
Reference in new issue
Block a user