From 037e89056aca6e0c58f1baea13f716108d20163e Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Thu, 15 Jun 2023 19:51:27 +0300 Subject: [PATCH] Actually deploy volsync with helm Install volsync using helm, removing the manual CRD install. We use `helm upgrade --install` to make the installation idempotent. Thanks: Tesshu Flower Signed-off-by: Nir Soffer --- test/addons/volsync/start | 51 ++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/test/addons/volsync/start b/test/addons/volsync/start index ca8a682cf7..e05849bcfc 100755 --- a/test/addons/volsync/start +++ b/test/addons/volsync/start @@ -6,28 +6,51 @@ import os import sys +from drenv import commands from drenv import kubectl -CRDS = [ - "../../../hack/test/volsync.backube_replicationsources.yaml", - "../../../hack/test/volsync.backube_replicationdestinations.yaml", -] +NAMESPACE = "volsync-system" +DEPLOYMENT = "volsync" def deploy(cluster): - print("Deploying volsync crds") - for crd in CRDS: - kubectl.apply(f"--filename={crd}", context=cluster) + print("Adding helm backube repo") + cmd = [ + "helm", + "repo", + "add", + "backube", + "https://backube.github.io/helm-charts/", + ] + for line in commands.watch(*cmd): + print(line) + + print("Installing volsync") + cmd = [ + "helm", + "upgrade", + "--install", + "--create-namespace", + "--namespace", + NAMESPACE, + DEPLOYMENT, + "backube/volsync", + "--kube-context", + cluster, + ] + for line in commands.watch(*cmd): + print(line) def wait(cluster): - print("Waiting until cdrs are established") - for crd in CRDS: - kubectl.wait( - "--for=condition=established", - f"--filename={crd}", - context=cluster, - ) + print(f"Waiting until deployment {DEPLOYMENT} is rolled out") + kubectl.rollout( + "status", + f"deploy/{DEPLOYMENT}", + f"--namespace={NAMESPACE}", + "--timeout=300s", + context=cluster, + ) if len(sys.argv) != 2: