Fix KIND redeploy issue when using helm
When installing KIND based K8s clusters using helm[#], the initial
deployment goes fine. However, when we try to redeploy (i.e, re-run
the same command), it's failing and this PR fixes it.
[#] make ci e2e status=keep deploytool=helm
Fixes issue:
@@ -83,9 +83,22 @@ function helm_install_subm() {
function install_subm_all_clusters() {
+ if kubectl --context=cluster1 get crd clusters.submariner.io > /dev/null 2>&1; then
+ echo Submariner CRDs already exist, skipping broker creation...
+ else
+ echo Installing Submariner Broker in cluster1...
helm_install_subm cluster1 ${cluster_CIDRs[cluster1]} ${service_CIDRs[cluster1]} false
- helm_install_subm cluster2 ${cluster_CIDRs[cluster2]} ${service_CIDRs[cluster2]} true
- helm_install_subm cluster3 ${cluster_CIDRs[cluster3]} ${service_CIDRs[cluster3]} true
+ fi
+
+ for i in 2 3; do
+ cluster_id=cluster$i
+ if kubectl --context=$cluster_id wait --for=condition=Ready pods -l app=submariner-engine -n submariner --timeout=60s > /dev/null 2>&1; then
+ echo Submariner already installed in $cluster_id, skipping submariner helm installation...
+ else
+ echo Installing Submariner in $cluster_id...
+ helm_install_subm $cluster_id ${cluster_CIDRs[$cluster_id]} ${service_CIDRs[$cluster_id]} true
+ fi
+ done
}
function deploytool_postreqs() {
