loft-sh / vcluster

vCluster - Create fully functional virtual Kubernetes clusters - Each vcluster runs inside a namespace of the underlying k8s cluster. It's cheaper than creating separate full-blown clusters and it offers better multi-tenancy and isolation than regular namespaces.
https://www.vcluster.com
Apache License 2.0
6.28k stars 399 forks source link

Allow context name in generated kube config to be specified #523

Closed tekumara closed 2 years ago

tekumara commented 2 years ago

Is your feature request related to a problem?

vcluster connect creates a kubeconfig.yaml with a context named Default:

...
contexts:
- context:
    cluster: local
    namespace: default
    user: user
  name: Default
current-context: Default
...

I'd like to merge this with my existing kubeconfig.yaml which already has a context named default

Which solution do you suggest?

An option to specify the generated context name, eg:

vcluster connect vcluster-1 --kube-config ~/.kube/vcluster.yaml --kube-config-context-name my-awesome-vcluster

Which alternative solutions exist?

Manually modifying the generated kubeconfig yaml

Additional context

No response

FabianKramm commented 2 years ago

@tekumara thanks for creating this issue! Yes we can add that option!