Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazkh committed Nov 9, 2024
1 parent 38e27e7 commit 8876ae4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def flavors():
if "aks" in settings.get("kustomize_substitutions", {}).get("MGMT_CLUSTER_NAME", ""):
delete_all_workload_clusters += clear_aks_vnet_peerings()

delete_all_workload_clusters += "; echo \"\n-----------------------------------\n\""

local_resource(
name = "delete-all-workload-clusters",
cmd = ["sh", "-ec", delete_all_workload_clusters],
Expand Down Expand Up @@ -399,9 +399,9 @@ def deploy_worker_templates(template, substitutions):
flavor_cmd += "; " + kubectl_cmd + " get secret ${CLUSTER_NAME}-kubeconfig -o jsonpath={.data.value} | base64 --decode > ./${CLUSTER_NAME}.kubeconfig"
flavor_cmd += "; chmod 600 ./${CLUSTER_NAME}.kubeconfig"
flavor_cmd += "; echo \"Kubeconfig for $CLUSTER_NAME created and saved in the local\""
flavor_cmd += "; echo \"Waiting for $CLUSTER_NAME nodes to become available\""
flavor_cmd += "; echo \"Waiting for $CLUSTER_NAME API Server to be accessible\""
flavor_cmd += "; until " + kubectl_cmd + " --kubeconfig=./${CLUSTER_NAME}.kubeconfig get nodes > /dev/null 2>&1; do sleep 5; done"
flavor_cmd += "; echo \"Nodes for $CLUSTER_NAME are available\""
flavor_cmd += "; echo \"API Server of $CLUSTER_NAME is accessible\""

# copy the kubeadm configmap to the calico-system namespace.
# This is a workaround needed for the calico-node-windows daemonset to be able to run in the calico-system namespace.
Expand All @@ -414,7 +414,7 @@ def deploy_worker_templates(template, substitutions):
flavor_cmd += peer_vnets()

flavor_cmd += get_addons(flavor_name)
flavor_cmd += "; echo \"\n-----------------------------------\n\""

local_resource(
name = flavor_name,
cmd = ["sh", "-ec", flavor_cmd],
Expand Down Expand Up @@ -524,6 +524,7 @@ def clear_aks_vnet_peerings():
delete_peering_cmd += "; az network vnet wait --resource-group ${AKS_RESOURCE_GROUP} --name ${AKS_MGMT_VNET_NAME} --created --timeout 180"
delete_peering_cmd += "; echo \" 1/2 ${AKS_MGMT_VNET_NAME} found \""

# TODO: xargs: command line cannot be assembled, too long
delete_peering_cmd += "; az network vnet peering list --resource-group ${AKS_RESOURCE_GROUP} --vnet-name ${AKS_MGMT_VNET_NAME} --output tsv | xargs -I {} az network vnet peering delete --name {} --resource-group ${AKS_RESOURCE_GROUP} --vnet-name ${AKS_MGMT_VNET_NAME} --only-show-errors --output none"
delete_peering_cmd += "; echo \" 2/2 All peerings deleted in mgmt cluster's vnet ${AKS_MGMT_VNET_NAME}\""

Expand Down

0 comments on commit 8876ae4

Please sign in to comment.