k8s-multicluster-ingress icon indicating copy to clipboard operation
k8s-multicluster-ingress copied to clipboard

Cannot configure backend Capacity

Open skolenkin opened this issue 4 years ago • 0 comments

The capacity parameter on each Backend always is 100%

According to GitHub code: https://github.com/GoogleCloudPlatform/k8s-multicluster-ingress/blob/master/app/kubemci/pkg/gcp/backendservice/backendservicesyncer.go#L300-L309 Backend service with RATE balancing mode has max rate

func desiredBackends(igLinks []string) []*compute.Backend {
	// Sort the slice so we get determistic results.
	sort.Strings(igLinks)
	var backends []*compute.Backend
	for _, ig := range igLinks {
		backends = append(backends, &compute.Backend{
			Group: ig,
			// We create the backend service with RATE balancing mode and set max rate
			// per instance to max value so that all requests in a region are sent to
			// instances in that region.
			// Setting rps to 1, for example, would round robin requests amongst all
			// instances.
			BalancingMode:      "RATE",
			MaxRatePerInstance: 1e14,
			// We have to fill in these fields so we can properly compare to what's returned to us
			CapacityScaler: 1,
		})
	}
	return backends
}

Even if you decide to change capacity manually on the LoadBalancer backend configuration MCI backendservicesyncer will replace changes to the default value (100% for each backend).

Based on: https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-for-anthos

Overview
Ingress for Anthos (Ingress) is a cloud-hosted multi-cluster Ingress controller for Anthos GKE clusters. It's a Google-hosted service that supports deploying shared load balancing resources across clusters and across regions. 

this (load balancing across clusters) will never happen.

We have checked it by deploying 2 GKE cluster in different EU regions. Connect to LoadBalancer VIP from EU leads to always response from application in the first GKE Cluster in EU. From US we have approximately 60%-80% connections to application in the first GKE Cluster in EU.

skolenkin avatar Apr 13 '20 11:04 skolenkin