Skip to content

Commit

Permalink
valkey-primary and valkey-replica pvcs added to mastodon restore indi…
Browse files Browse the repository at this point in the history
…vidually
  • Loading branch information
jessebot committed Oct 23, 2024
1 parent b3bc6a0 commit 9ee6200
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions smol_k8s_lab/k8s_apps/social/mastodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,21 +547,22 @@ def restore_mastodon(argocd: ArgoCD,
argocd.k8s.apply_manifests(podconfig_yaml, argocd.namespace)

# then we begin the restic restore of all the mastodon PVCs we lost
pvc_enabled = secrets.get('valkey_pvc_enabled', 'false')
if pvc_enabled and pvc_enabled.lower() != 'false':
# restores the mastodon pvc
k8up_restore_pvc(argocd.k8s,
'mastodon',
'mastodon-valkey',
'mastodon',
s3_backup_endpoint,
s3_backup_bucket,
access_key_id,
secret_access_key,
restic_repo_password,
snapshot_ids['mastodon_valkey'],
"file-backups-podconfig"
)
for pvc in ['valkey-primary', 'valkey-replica']:
pvc_enabled = secrets.get('valkey_pvc_enabled', 'false')
if pvc_enabled and pvc_enabled.lower() != 'false':
# restores the mastodon pvc
k8up_restore_pvc(k8s_obj=argocd.k8s,
app='mastodon',
pvc=f'mastodon-{pvc}',
namespace='mastodon',
s3_endpoint=s3_backup_endpoint,
s3_bucket=s3_backup_bucket,
access_key_id=access_key_id,
secret_access_key=secret_access_key,
restic_repo_password=restic_repo_password,
snapshot_id=snapshot_ids[f'mastodon_{pvc}'],
pod_config="file-backups-podconfig"
)

# todo: from here on out, this could be async to start on other tasks
# install mastodon as usual, but wait on it this time
Expand Down

0 comments on commit 9ee6200

Please sign in to comment.