Skip to content

Commit

Permalink
Deploy velero on the cluster
Browse files Browse the repository at this point in the history
Use the velero command (new requirement) to install velero on the
managed clusters.

Installing velero also installs velero crds, so previous code to install
them was removed.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Jun 1, 2023
1 parent 16eefd3 commit 335fd26
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ramenctl/ramenctl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import drenv
from drenv import kubectl
from drenv import minio

from . import minio
from . import command


Expand Down
38 changes: 17 additions & 21 deletions test/addons/velero/start
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,25 @@
import os
import sys

from drenv import kubectl

CRDS = [
"../../../hack/test/velero.io_backups.yaml",
"../../../hack/test/velero.io_restores.yaml",
]

from drenv import commands
from drenv import minio

def deploy(cluster):
print("Deploying velero crds")
for crd in CRDS:
kubectl.apply(f"--filename={crd}", context=cluster)


def wait(cluster):
print("Waiting until cdrs are established")
for crd in CRDS:
kubectl.wait(
"--for=condition=established",
f"--filename={crd}",
context=cluster,
)
print("Deploying velero")
s3_url = minio.service_url(cluster)
for line in commands.watch(
"velero",
"install",
"--provider=aws",
"--plugins=velero/velero-plugin-for-aws:v1.2.1",
"--bucket=bucket",
"--secret-file=credentials.conf",
"--use-volume-snapshots=false",
f'--backup-location-config=region=minio,s3ForcePathStyle=true,s3Url={s3_url}',
f"--kubecontext={cluster}",
"--wait",
):
print(line)


if len(sys.argv) != 2:
Expand All @@ -38,4 +35,3 @@ os.chdir(os.path.dirname(__file__))
cluster = sys.argv[1]

deploy(cluster)
wait(cluster)

0 comments on commit 335fd26

Please sign in to comment.