arrstack: fix sync-wave deadlock + config multi-attach
ci/woodpecker/pr/vector-test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful

The active-active arrstack deploy (#383) was stuck: the app Deployments
(wave 0) can't become Healthy without their database, so ArgoCD never
advanced to wave 1 to create the shared Postgres cluster. And /config was
an RWO cephrbd PVC, so 3 replicas hit Multi-Attach.

- move DB infra ahead of the apps: VSS + backup ObjectStoreUser/Bucket
  wave -3, CNPG Cluster -2, Databases -1 (apps stay at default 0)
- switch each app's /config to emptyDir (per-pod, stateless; library is
  in Postgres, config is env-driven; MediaCover regenerates). Old RWO
  config PVCs orphan.
This commit is contained in:
2026-08-22 12:21:25 +10:00
parent e0d47295f2
commit df687e310b
12 changed files with 15 additions and 16 deletions
@@ -7,6 +7,9 @@ kind: ObjectStoreUser
metadata: metadata:
name: cnpg-arrstack-backup name: cnpg-arrstack-backup
namespace: arrstack namespace: arrstack
annotations:
# S3 creds Secret must exist before the Cluster (wave -2) reconciles its backup.
argocd.argoproj.io/sync-wave: "-3"
spec: spec:
displayName: "CNPG backup owner (arrstack)" displayName: "CNPG backup owner (arrstack)"
uid: cnpg-arrstack-backup uid: cnpg-arrstack-backup
@@ -19,6 +22,8 @@ kind: Bucket
metadata: metadata:
name: cnpg-arrstack name: cnpg-arrstack
namespace: arrstack namespace: arrstack
annotations:
argocd.argoproj.io/sync-wave: "-3"
spec: spec:
placementTarget: ec placementTarget: ec
bucketName: cnpg-arrstack bucketName: cnpg-arrstack
@@ -15,7 +15,7 @@ metadata:
# Wave 1: the per-app <app>-db Secrets (wave 0) must exist first — CNPG reads # Wave 1: the per-app <app>-db Secrets (wave 0) must exist first — CNPG reads
# them as the managed roles' passwordSecret. ArgoCD gates dependents on the # them as the managed roles' passwordSecret. ArgoCD gates dependents on the
# Cluster's health status. # Cluster's health status.
argocd.argoproj.io/sync-wave: "1" argocd.argoproj.io/sync-wave: "-2"
spec: spec:
inheritedMetadata: inheritedMetadata:
annotations: annotations:
@@ -8,7 +8,7 @@ metadata:
name: prowlarr-main name: prowlarr-main
namespace: arrstack namespace: arrstack
annotations: annotations:
argocd.argoproj.io/sync-wave: "2" argocd.argoproj.io/sync-wave: "-1"
spec: spec:
cluster: cluster:
name: arrstack-postgres name: arrstack-postgres
@@ -8,7 +8,7 @@ metadata:
name: radarr-main name: radarr-main
namespace: arrstack namespace: arrstack
annotations: annotations:
argocd.argoproj.io/sync-wave: "2" argocd.argoproj.io/sync-wave: "-1"
spec: spec:
cluster: cluster:
name: arrstack-postgres name: arrstack-postgres
@@ -8,7 +8,7 @@ metadata:
name: sonarr-main name: sonarr-main
namespace: arrstack namespace: arrstack
annotations: annotations:
argocd.argoproj.io/sync-wave: "2" argocd.argoproj.io/sync-wave: "-1"
spec: spec:
cluster: cluster:
name: arrstack-postgres name: arrstack-postgres
@@ -14,7 +14,7 @@ metadata:
name: sonarr-db name: sonarr-db
namespace: arrstack namespace: arrstack
annotations: annotations:
argocd.argoproj.io/sync-wave: "0" argocd.argoproj.io/sync-wave: "-3"
spec: spec:
destination: destination:
create: true create: true
@@ -33,7 +33,7 @@ metadata:
name: radarr-db name: radarr-db
namespace: arrstack namespace: arrstack
annotations: annotations:
argocd.argoproj.io/sync-wave: "0" argocd.argoproj.io/sync-wave: "-3"
spec: spec:
destination: destination:
create: true create: true
@@ -52,7 +52,7 @@ metadata:
name: prowlarr-db name: prowlarr-db
namespace: arrstack namespace: arrstack
annotations: annotations:
argocd.argoproj.io/sync-wave: "0" argocd.argoproj.io/sync-wave: "-3"
spec: spec:
destination: destination:
create: true create: true
+1 -2
View File
@@ -92,5 +92,4 @@ spec:
mountPath: /config mountPath: /config
volumes: volumes:
- name: config - name: config
persistentVolumeClaim: emptyDir: {}
claimName: prowlarr-config
@@ -3,7 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- pvc-config.yaml
- vaultstaticsecret.yaml - vaultstaticsecret.yaml
- configmap.yaml - configmap.yaml
- deployment.yaml - deployment.yaml
+1 -2
View File
@@ -94,8 +94,7 @@ spec:
mountPath: /media/movies mountPath: /media/movies
volumes: volumes:
- name: config - name: config
persistentVolumeClaim: emptyDir: {}
claimName: radarr-config
- name: media-movies - name: media-movies
persistentVolumeClaim: persistentVolumeClaim:
claimName: media-movies claimName: media-movies
@@ -3,7 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- pvc-config.yaml
- vaultstaticsecret.yaml - vaultstaticsecret.yaml
- configmap.yaml - configmap.yaml
- deployment.yaml - deployment.yaml
+1 -2
View File
@@ -94,8 +94,7 @@ spec:
mountPath: /media/tv mountPath: /media/tv
volumes: volumes:
- name: config - name: config
persistentVolumeClaim: emptyDir: {}
claimName: sonarr-config
- name: media-tv - name: media-tv
persistentVolumeClaim: persistentVolumeClaim:
claimName: media-tv claimName: media-tv
@@ -3,7 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- pvc-config.yaml
- vaultstaticsecret.yaml - vaultstaticsecret.yaml
- configmap.yaml - configmap.yaml
- deployment.yaml - deployment.yaml