Skip to content

Commit

Permalink
remove references to EBS
Browse files Browse the repository at this point in the history
  • Loading branch information
sunu committed Dec 18, 2024
1 parent a4ba4fe commit b58b55e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions deployer/commands/exec/infra_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ def root_homes(
),
restore_volume_id: str = typer.Option(
None,
help="ID of EBS volume to mount (e.g. vol-1234567890abcdef0) "
help="ID of volume to mount (e.g. vol-1234567890abcdef0) "
"to restore data from",
),
restore_mount_path: str = typer.Option(
"/restore-volume", help="Mount point for the EBS volume"
"/restore-volume", help="Mount point for the volume"
),
restore_volume_size: str = typer.Option("100Gi", help="Size of the EBS volume"),
restore_volume_size: str = typer.Option("100Gi", help="Size of the volume"),
):
"""
Pop an interactive shell with the entire nfs file system of the given cluster mounted on /root-homes
Expand Down Expand Up @@ -92,16 +92,14 @@ def root_homes(
]

if restore_volume_id:
# Create PV for EBS volume
# Create PV for volume
pv_name = f"restore-{restore_volume_id}"
pv = {
"apiVersion": "v1",
"kind": "PersistentVolume",
"metadata": {"name": pv_name},
"spec": {
"capacity": {
"storage": restore_volume_size
}, # Arbitrary size, actual size determined by EBS volume
"capacity": {"storage": restore_volume_size},
"volumeMode": "Filesystem",
"accessModes": ["ReadWriteOnce"],
"persistentVolumeReclaimPolicy": "Retain",
Expand Down Expand Up @@ -138,9 +136,11 @@ def root_homes(
}

volumes.append(
{"name": "ebs-volume", "persistentVolumeClaim": {"claimName": pv_name}}
{"name": "restore-volume", "persistentVolumeClaim": {"claimName": pv_name}}
)
volume_mounts.append(
{"name": "restore-volume", "mountPath": restore_mount_path}
)
volume_mounts.append({"name": "ebs-volume", "mountPath": restore_mount_path})

if extra_nfs_server and extra_nfs_base_path and extra_nfs_mount_path:
volumes.append(
Expand Down Expand Up @@ -200,7 +200,7 @@ def root_homes(
tmpf.flush()

with cluster.auth():
# If we have an EBS volume, create PV and PVC first
# If we have an volume to restore from, create PV and PVC first
if restore_volume_id:
with tempfile.NamedTemporaryFile(mode="w", suffix=".json") as pv_tmpf:
json.dump(pv, pv_tmpf)
Expand Down

0 comments on commit b58b55e

Please sign in to comment.