@@ -76,6 +76,7 @@ main() {
7676 return ${exit_code}
7777 fi
7878
79+ apply_hpc_webhook
7980 run_e2e_test
8081}
8182
@@ -265,7 +266,7 @@ create_cluster(){
265266 log " Install cluster api azure onto management cluster"
266267 " $TOOLS_BIN_DIR " /clusterctl init --infrastructure azure
267268 log " wait for core CRDs to be installed"
268- kubectl wait --for=condition=ready pod --all -n capz-system --timeout - 300s
269+ kubectl wait --for=condition=ready pod --all -n capz-system --timeout= 300s
269270 # Wait for the core CRD resources to be "installed" onto the mgmt cluster before returning control
270271 timeout --foreground 300 bash -c " until kubectl get clusters -A > /dev/null 2>&1; do sleep 3; done"
271272 timeout --foreground 300 bash -c " until kubectl get azureclusters -A > /dev/null 2>&1; do sleep 3; done"
@@ -433,6 +434,47 @@ apply_cloud_provider_azure() {
433434 " $TOOLS_BIN_DIR " /helm upgrade cloud-provider-azure --install --namespace kube-system --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure " ${CCM_IMG_ARGS[@]} "
434435}
435436
437+ apply_hpc_webhook (){
438+ log " applying configuration for HPC webhook"
439+
440+ # ensure cert-manager and webhook pods land on Linux nodes
441+ log " untainting control-plane nodes"
442+ mapfile -t cp_nodes < <( kubectl get nodes | grep control-plane | awk ' {print $1}' )
443+ kubectl taint nodes " ${cp_nodes[@]} " node-role.kubernetes.io/control-plane:NoSchedule- || true
444+
445+ log " tainting windows nodes"
446+ mapfile -t windows_nodes < <( kubectl get nodes -o wide | grep Windows | awk ' {print $1}' )
447+ kubectl taint nodes " ${windows_nodes[@]} " os=windows:NoSchedule
448+
449+ log " installing cert-manager via helm"
450+ " $TOOLS_BIN_DIR " /helm install \
451+ --repo https://charts.jetstack.io \
452+ --namespace cert-manager \
453+ --create-namespace \
454+ --set crds.enabled=true \
455+ --wait \
456+ cert-manager cert-manager
457+
458+ log " wait for cert-manager pods to start"
459+ timeout 5m kubectl wait --for=condition=ready pod --all -n cert-manager --timeout -1s
460+
461+ log " installing HPC mutating webhook via helm"
462+ " $TOOLS_BIN_DIR " /helm install hpc-webhook " ${SCRIPT_ROOT} /../helpers/helm" \
463+ -f " ${SCRIPT_ROOT} /../helpers/helm/values-hpc.yaml" \
464+ --create-namespace
465+
466+ log " wait for HPC webhook pods to start"
467+ timeout 5m kubectl wait --for=condition=ready pod --all -n hpc-webhook --timeout -1s
468+
469+ log " untainting Windows agent nodes"
470+ kubectl taint nodes " ${windows_nodes[@]} " os=windows:NoSchedule-
471+
472+ log " tainting control-plane nodes again"
473+ kubectl taint nodes " ${cp_nodes[@]} " node-role.kubernetes.io/control-plane:NoSchedule || true
474+
475+ log " done configuring HPC webhook"
476+ }
477+
436478apply_hyperv_configuration (){
437479 set -x
438480 log " applying configuration for testing hyperv isolated containers"
@@ -458,13 +500,13 @@ apply_hyperv_configuration(){
458500 log " installing admission controller webhook"
459501 kubectl apply -f " ${SCRIPT_ROOT} /../helpers/hyper-v-mutating-webhook/deployment.yaml"
460502
461- log " wait for webhook pods to go start"
503+ log " wait for webhook pods to start"
462504 timeout 5m kubectl wait --for=condition=ready pod --all -n hyperv-webhook-system --timeout -1s
463505
464506 log " untainting Windows agent nodes"
465507 kubectl taint nodes " ${windows_nodes[@]} " os=windows:NoSchedule-
466508
467- log " tainting master nodes again"
509+ log " tainting control-plane nodes again"
468510 kubectl taint nodes " ${cp_nodes[@]} " node-role.kubernetes.io/control-plane:NoSchedule || true
469511
470512 log " done configuring testing for hyperv isolated containers"
0 commit comments