Skip to content

Commit

Permalink
Actually deploy volsync with helm
Browse files Browse the repository at this point in the history
Install volsync using helm, removing the manual CRD install.
We use `helm upgrade --install` to make the installation idempotent.

Thanks: Tesshu Flower <tflower@redhat.com>
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Jun 15, 2023
1 parent 5043c86 commit 037e890
Showing 1 changed file with 37 additions and 14 deletions.
51 changes: 37 additions & 14 deletions test/addons/volsync/start
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 037e890

Please sign in to comment.