diff --git a/Makefile b/Makefile index d6685581..b7364450 100644 --- a/Makefile +++ b/Makefile @@ -153,9 +153,24 @@ create-capl-cluster: # Create a CAPL cluster with updated CCM and wait for it to be ready kubectl apply -f capl-cluster-manifests.yaml kubectl wait --for=condition=ControlPlaneReady cluster/$(CLUSTER_NAME) --timeout=600s || (kubectl get cluster -o yaml; kubectl get linodecluster -o yaml; kubectl get linodemachines -o yaml) - kubectl wait --for=condition=NodeHealthy=true machines -l cluster.x-k8s.io/cluster-name=$(CLUSTER_NAME) --timeout=900s + kubectl wait --for=condition=NodeHealthy=true machines -l cluster.x-k8s.io/cluster-name=$(CLUSTER_NAME) --timeout=900s || \ + ( \ + clusterctl get kubeconfig $(CLUSTER_NAME) > $(KUBECONFIG_PATH) \ + kubectl get machinedeployment -A -o yaml; \ + kubectl get linodemachine -A -o yaml; \ + KUBECONFIG=$(KUBECONFIG_PATH) kubectl get nodes -o wide; \ + KUBECONFIG=$(KUBECONFIG_PATH) kubectl get pods -A -o wide; \ + KUBECONFIG=$(KUBECONFIG_PATH) kubectl get events -A; \ + ) clusterctl get kubeconfig $(CLUSTER_NAME) > $(KUBECONFIG_PATH) - KUBECONFIG=$(KUBECONFIG_PATH) kubectl wait --for=condition=Ready nodes --all --timeout=600s + KUBECONFIG=$(KUBECONFIG_PATH) kubectl wait --for=condition=Ready nodes --all --timeout=600s || \ + ( \ + kubectl get machinedeployment -A -o yaml; \ + kubectl get linodemachine -A -o yaml; \ + KUBECONFIG=$(KUBECONFIG_PATH) kubectl get nodes -o wide; \ + KUBECONFIG=$(KUBECONFIG_PATH) kubectl get pods -A -o wide; \ + KUBECONFIG=$(KUBECONFIG_PATH) kubectl get events -A; \ + ) # Remove all taints from control plane node so that pods scheduled on it by tests can run (without this, some tests fail) KUBECONFIG=$(KUBECONFIG_PATH) kubectl taint nodes -l node-role.kubernetes.io/control-plane node-role.kubernetes.io/control-plane-