Skip to content

Commit cae9ec1

Browse files
author
redhat-appstudio-qe-bot
committed
Added more debug inforamtion when deploy cluster fail
1 parent f8f9a6e commit cae9ec1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ci/images/ci-runner/hack/bin/deploy-cluster.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ fetch_bitwarden_secrets() {
1919
get_aws_credentials
2020
}
2121

22+
print_debug_info() {
23+
printf "Print debug info......\n" | indent 2
24+
25+
printf "HostedCluster CR Status: " | indent 4
26+
kubectl -n clusters get hostedcluster "$CLUSTER_NAME" -o yaml
27+
28+
printf "Control Plane pods of HostedCluster: " | indent 4
29+
kubectl -n "clusters-${CLUSTER_NAME}" get pods
30+
31+
# Export kubeconfig of hosted cluster
32+
hypershift create kubeconfig --name "$CLUSTER_NAME" > "${CLUSTER_NAME}.kubeconfig"
33+
34+
printf "Cluster Operators on Hosted Cluster: " | indent 4
35+
kubectl --kubeconfig="${CLUSTER_NAME}.kubeconfig" get co -o yaml
36+
}
37+
2238
deploy_cluster() {
2339
setx_off
2440
hypershift create cluster aws --pull-secret "$PULL_SECRET" --aws-creds "$AWS_CREDENTIALS" --name "$CLUSTER_NAME" --node-pool-replicas=2 --base-domain "$BASE_DOMAIN" --region="$REGION" --release-image="$IMAGE" --root-volume-type=gp3 --root-volume-size=120 --instance-type=m5.2xlarge
@@ -35,7 +51,7 @@ deploy_cluster() {
3551
]; do
3652
if [ "$wait_period" -gt 1800 ]; then
3753
echo "[ERROR] Failed to create OCP cluster." >&2
38-
kubectl -n clusters get hostedcluster "$CLUSTER_NAME" -o yaml
54+
print_debug_info
3955
exit 1
4056
fi
4157
sleep 60

0 commit comments

Comments
 (0)