diff --git a/charts/matrix-synapse/templates/deployment.yaml b/charts/matrix-synapse/templates/deployment.yaml index 095795f..f89cddc 100644 --- a/charts/matrix-synapse/templates/deployment.yaml +++ b/charts/matrix-synapse/templates/deployment.yaml @@ -16,6 +16,8 @@ metadata: app.kubernetes.io/component: synapse spec: replicas: 1 + strategy: + {{- toYaml .Values.synapse.strategy | nindent 4 }} selector: matchLabels: {{- include "matrix-synapse.selectorLabels" . | nindent 6 }} diff --git a/charts/matrix-synapse/templates/worker-deployment.yaml b/charts/matrix-synapse/templates/worker-deployment.yaml index 958a74b..7ea7cd9 100644 --- a/charts/matrix-synapse/templates/worker-deployment.yaml +++ b/charts/matrix-synapse/templates/worker-deployment.yaml @@ -13,6 +13,10 @@ metadata: app.kubernetes.io/component: {{ $name }} spec: replicas: {{ $config.replicaCount | default $default.replicaCount }} + {{- with ($config.strategy | default $default.strategy) }} + strategy: + {{- toYaml . | nindent 4 }} + {{- end }} selector: matchLabels: {{- include "matrix-synapse.selectorLabels" $ | nindent 6 }} diff --git a/charts/matrix-synapse/values.yaml b/charts/matrix-synapse/values.yaml index d809921..4e0b181 100644 --- a/charts/matrix-synapse/values.yaml +++ b/charts/matrix-synapse/values.yaml @@ -145,6 +145,15 @@ extraSecrets: {} ## Configuration to apply to the main Synapse pod. ## synapse: + ## Only really applicable when the deployment has an RWO PV attached (e.g. when media repository + ## is enabled for the main Synapse pod) + ## Since replicas = 1, an update can get "stuck", as the previous pod remains attached to the + ## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will + ## terminate the single previous pod, so that the new, incoming pod can attach to the PV + ## + strategy: + type: RollingUpdate + ## Annotations to apply to the main Synapse pod. ## annotations: {} @@ -260,6 +269,14 @@ workers: ## replicaCount: 1 + ## Update strategy - only really applicable for deployments with RWO PVs attached (e.g. media repository) + ## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the + ## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will + ## terminate the single previous pod, so that the new, incoming pod can attach to the PV + ## + strategy: + type: RollingUpdate + ## A specific name for this worker, can't be set globally. ## Note that this can only be set when replicaCount is 1 #name: