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.35k stars 406 forks source link

vcluster connect command overrides kubeconfig.yaml file #158

Closed developer-guy closed 2 years ago

developer-guy commented 2 years ago

Wouldn't it be nice to add support of merging if the kubeconfig.yaml file already exists instead of overriding it? Because in some cases, like avoiding connection issues while forwarding port to local port, I might prefer to change the service type from ClusterIP to NodePort or I can already have it kubeconfig.yaml; in such cases, I might want to edit the existing kubeconfig.yaml file, so when I run connect again, all my changes were lost.

cc: @dentrax @erkanzileli

FabianKramm commented 2 years ago

@developer-guy thanks for creating this issue! We already have a flag for this called --update-current, so you could run:

KUBECONFIG=my-config.yaml vcluster connect ... --update-current

Or is this not what you want?

developer-guy commented 2 years ago

@developer-guy thanks for creating this issue! We already have a flag for this called --update-current, so you could run:


KUBECONFIG=my-config.yaml vcluster connect ... --update-current

Or is this not what you want?

Exactly, sorry I didnt see this flag, thank you, Im closing this one