vmware-tanzu / tanzu-framework

Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging and plugins to provide users with a much stronger, more integrated experience than the loose coupling and stand-alone commands of the previous generation of tools.
Apache License 2.0
197 stars 193 forks source link

Cryptic error message if using `--use-existing-bootstrap-cluster` with non-existing cluster #205

Open mike1808 opened 3 years ago

mike1808 commented 3 years ago

Bug description

CLI fails to create a management cluster if there is no ~/.kube folder.

Affected product area (please put an X in all that apply)

Expected behavior

Management clusters should be created no matter if kubectl config folder exist or not.

Steps to reproduce the bug

Remove (or rename) ~/.kube folder and create a management cluster.

Version (include the SHA if the version is not obvious)

version: v1.4.0-pre-alpha-2
buildDate: 2021-07-14
sha: e158c33

Environment where the bug was observed (cloud, OS, etc) Nimbus, Ubuntu 16.04

Relevant Debug Output (Logs, manifests, etc)

tanzu management-cluster create  --yes -v 9 --deploy-tkg-on-vSphere7 --use-existing-bootstrap-cluster -f tkg-mgmt-vc.yaml
Downloading the TKG Compatibility file from Image name 'projects-stg.registry.vmware.com/tkg/v1.4.0-zshippable/tkg-compatibility:v1
Downloading the TKG BOM file from Image name 'projects-stg.registry.vmware.com/tkg/tkg-bom:v1.4.0-zshippable
BOM file "/home/kubo/.config/tanzu/tkg/bom/tkg-bom-v1.4.0-zshippable.yaml" already exist, so skipped saving the downloaded BOM file
Downloading the TKr BOM file from Image name 'projects-stg.registry.vmware.com/tkg/tkr-bom:v1.21.2_vmware.1-tkg.1-zshippable
BOM file "/home/kubo/.config/tanzu/tkg/bom/tkr-bom-v1.21.2+vmware.1-tkg.1-zshippable.yaml" already exist, so skipped saving the downloaded BOM file
Downloading the TKG Compatibility file from Image name 'projects-stg.registry.vmware.com/tkg/v1.4.0-zshippable/tkg-compatibility:v1
Downloading the TKG BOM file from Image name 'projects-stg.registry.vmware.com/tkg/tkg-bom:v1.4.0-zshippable
BOM file "/home/kubo/.config/tanzu/tkg/bom/tkg-bom-v1.4.0-zshippable.yaml" already exist, so skipped saving the downloaded BOM file
Downloading the TKr BOM file from Image name 'projects-stg.registry.vmware.com/tkg/tkr-bom:v1.21.2_vmware.1-tkg.1-zshippable
BOM file "/home/kubo/.config/tanzu/tkg/bom/tkr-bom-v1.21.2+vmware.1-tkg.1-zshippable.yaml" already exist, so skipped saving the downloaded BOM file
CEIP Opt-in status: false

Validating the pre-requisites...

vSphere 7.0 Environment Detected.

You have connected to a vSphere 7.0 environment which does not have vSphere with Tanzu enabled. vSphere with Tanzu includes
an integrated Tanzu Kubernetes Grid Service which turns a vSphere cluster into a platform for running Kubernetes workloads in dedicated
resource pools. Configuring Tanzu Kubernetes Grid Service is done through vSphere HTML5 client.

Tanzu Kubernetes Grid Service is the preferred way to consume Tanzu Kubernetes Grid in vSphere 7.0 environments. Alternatively you may
deploy a non-integrated Tanzu Kubernetes Grid instance on vSphere 7.0.
Deploying TKG management cluster on vSphere 7.0 ...
Identity Provider not configured. Some authentication features won't work.
no os options provided, selecting based on default os options

Setting up management cluster...
Validating configuration...
Using infrastructure provider vsphere:v0.7.8
Generating cluster configuration...
Setting up bootstrapper...
Error: unable to set up management cluster: unable to create bootstrap cluster: open /home/kubo/.kube/config: no such file or directory
mike1808 commented 3 years ago

Sorry, this happened because of --use-existing-bootstrap-cluster flag and I had no existing cluster. Closing.

randomvariable commented 3 years ago

Re-opening as it's a cryptic error in any case.

vuil commented 2 years ago

@prkalle can you help take a look?

mcwumbly commented 2 years ago

I just ran into this. At least this issue exists to document the problem!