vcluster icon indicating copy to clipboard operation
vcluster copied to clipboard

[Question] ClusterIP allocation within multi vclusters

Open litaojiao opened this issue 7 months ago • 2 comments

After creating multiple vclusters, when deploying a clusterIP service in each vcluster without specifying clusterIP, how does vcluster ensure that the IP addresses of the clusterIPs do not conflict? Because the clusterIPs are assigned by the API server within each vcluster, and each vcluster's API server is unaware of the services in other vclusters.

thanks!

litaojiao avatar May 20 '25 04:05 litaojiao

Each control-plane is fully separate from each other, and cluster-IPs are internal to each cluster, therefore the IPs won't clash. When a pod or service is synced to the host cluster, a net-new object is created there, and that control-plane is only one involved.

cbron avatar May 23 '25 23:05 cbron

Actually the host cluster assigns cluster IP for the services, so there are no conflicts thanks to this. Tру vCluster will first create a Service in the host and only then accept the resource creation request inside the vCluster API server.

matskiv avatar May 26 '25 09:05 matskiv

Each control-plane is fully separate from each other, and cluster-IPs are internal to each cluster, therefore the IPs won't clash. When a pod or service is synced to the host cluster, a net-new object is created there, and that control-plane is only one involved. thanks, i look at it.

litaojiao avatar Jun 27 '25 07:06 litaojiao

Actually the host cluster assigns cluster IP for the services, so there are no conflicts thanks to this. Tру vCluster will first create a Service in the host and only then accept the resource creation request inside the vCluster API server.

thans, that's it; when creates service in vcluster, Vcluster syncer will intercept the request through WithServiceCreateRedirect filter; The main function of this filter is to: Check if the request is a creation operation for Service If it is a create operation and not dry-run, call the createService function First create the service in the host cluster, and then create the corresponding service in the virtual cluster.

litaojiao avatar Jun 27 '25 07:06 litaojiao