loft-sh / vcluster-docs

Apache License 2.0
4 stars 21 forks source link

vcluster cli throws an error if exportKubeConfig.server does not have a port number when set #240

Closed brinker-tbaker closed 1 month ago

brinker-tbaker commented 1 month ago

when editing the exportKubeConfig.server property you have to specify the port number as well, otherwise an error is thrown from the vcluster cli as there are not 2 instances of a : in the path. This change updates the documentation to include the port number.

see pkg/cli/connect_helm.go

splitted := strings.Split(cluster.Server, ":")
if len(splitted) != 3 {
   return nil, fmt.Errorf("unexpected server in kubeconfig: %s", cluster.Server)
}
netlify[bot] commented 1 month ago

Deploy Preview for vcluster-docs-site ready!

Built without sensitive environment variables

Name Link
Latest commit b2791230b78ba3bb03196d360f6c7038dd974db6
Latest deploy log https://app.netlify.com/sites/vcluster-docs-site/deploys/66bcf260ad15cf0008686ff7
Deploy Preview https://deploy-preview-240--vcluster-docs-site.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

deniseschannon commented 1 month ago

@brinker-tbaker Can you confirm what version of the CLI that you're using?

brinker-tbaker commented 1 month ago

@deniseschannon

vcluster --version
vcluster version 0.20.0-beta.15

If the 0.20.0 release should NOT require a port number, i can submit a PR on the main repo for that instead if needed.

brinker-tbaker commented 1 month ago

tested again with version 0.20.0 (stable) as that was released overnight.

vcluster create test-vcluster --namespace test-vcluster --values /mnt/c/Users/tbaker/Desktop/vcluster/vcluster.yaml
12:18:43 info Create vcluster test-vcluster...
12:18:43 info execute command: helm upgrade test-vcluster /tmp/vcluster-0.20.0.tgz-2404148131 --create-namespace --kubeconfig /tmp/2629429279 --namespace test-vcluster --install --repository-config='' --values /tmp/758780762 --values vcluster.yaml
12:18:51 done Successfully created virtual cluster test-vcluster in namespace test-vcluster
12:18:51 info Waiting for vcluster to come up...
12:19:07 warn vcluster is waiting, because vcluster pod test-vcluster-846f5fd596-27k4w has status: PodInitializing
12:20:09 done vCluster is up and running
12:20:10 fatal unexpected server in kubeconfig: https://my.vcluster.fqdn