diff --git a/deploy/helm/templates/embedding/deployment.yaml b/deploy/helm/templates/embedding/deployment.yaml index 07e4c7e..6416039 100644 --- a/deploy/helm/templates/embedding/deployment.yaml +++ b/deploy/helm/templates/embedding/deployment.yaml @@ -9,7 +9,20 @@ metadata: spec: replicas: {{ .Values.embedding.replicaCount }} strategy: + {{- /* + A persistence-backed single replica reuses one fixed-name ReadWriteOnce + PVC (see the persistence block below) — RollingUpdate would schedule the + new pod before the old one releases the volume, deadlocking on a + Multi-Attach error since RWO can only be attached to one pod at a time. + Recreate avoids that by tearing down the old pod first. Once + replicaCount>1, persistence is disabled entirely (see below), so + RollingUpdate is safe there. + */}} + {{- if and .Values.embedding.persistence.enabled (le (int .Values.embedding.replicaCount) 1) }} + type: Recreate + {{- else }} type: RollingUpdate + {{- end }} selector: matchLabels: app.kubernetes.io/name: {{ include "inference-stack.name" . }} diff --git a/deploy/helm/templates/reranker/deployment.yaml b/deploy/helm/templates/reranker/deployment.yaml index a9ba9f3..ae26fe7 100644 --- a/deploy/helm/templates/reranker/deployment.yaml +++ b/deploy/helm/templates/reranker/deployment.yaml @@ -9,7 +9,20 @@ metadata: spec: replicas: {{ .Values.reranker.replicaCount }} strategy: + {{- /* + A persistence-backed single replica reuses one fixed-name ReadWriteOnce + PVC (see the persistence block below) — RollingUpdate would schedule the + new pod before the old one releases the volume, deadlocking on a + Multi-Attach error since RWO can only be attached to one pod at a time. + Recreate avoids that by tearing down the old pod first. Once + replicaCount>1, persistence is disabled entirely (see below), so + RollingUpdate is safe there. + */}} + {{- if and .Values.reranker.persistence.enabled (le (int .Values.reranker.replicaCount) 1) }} + type: Recreate + {{- else }} type: RollingUpdate + {{- end }} selector: matchLabels: app.kubernetes.io/name: {{ include "inference-stack.name" . }}