"cluster creation failed, reason:'BastionHostFailed'" error during Tanzu Kubernetes Grid management cluster creation on AWS
search cancel

"cluster creation failed, reason:'BastionHostFailed'" error during Tanzu Kubernetes Grid management cluster creation on AWS

book

Article ID: 306654

calendar_today

Updated On:

Products

Tanzu Kubernetes Grid

Issue/Introduction

Symptoms:
You are trying to create a Tanzu Kubernetes (TKG) management cluster on AWS. The attempt to create a cluster fails with the following error message:

unable to set up management cluster, : unable to wait for cluster and get the cluster kubeconfig: error waiting for cluster to be provisioned (this may take a few minutes): cluster creation failed, reason:'BastionHostFailed', message:'6 of 8 completed'


Environment

VMware Tanzu Kubernetes Grid 1.x

Cause

To find the root cause of the VM provisioning failure, you should look at the capa-controller-manager pod logs in the capa-system namespace:

kubectl logs deployment.apps/capa-controller-manager -n capa-system manager

If you see the below error in your logs, the error occurs because the key pair that you have referenced while creating the management cluster does not exist in the same region as the cluster.

E0408 00:06:37.554510 1 controller.go:257] controller-runtime/controller "msg"="Reconciler error" "error"="failed to reconcile bastion host for AWSCluster tkg-system/mgmt-oom: failed to run instance: InvalidKeyPair.NotFound: The key pair 'oom-tkg13' does not exist\n\tstatus code: 400, request id: f8eb5a93-1577-4b68-bd6d-eb4409f6deaf" "controller"="awscluster" "name"="mgmt-oom" "namespace"="tkg-system"

Resolution

Make sure that the AWS key pair that you are using to create the TKG management cluster is present in the same region as the management cluster.