Version
the main branch
Resources Settings
limits: memory 1Gi, CPU 500m
Platform
Openshift
Description:
The current EG implementation watches a lot of resources, such as HTTPRoute, GPCRoute, EnvoyProxy, etc., and a copy of these resources will be reserved in the EG memory, causing the EG memory usage to be very high. When the user's HTTPRoute and other resources continue to increase, the memory of EG will take up more, and the user needs to adjust the resource limits dynamically ?

When any resource changes, EG will trigger the behavior of these changes, such as translation and infrastructure reconstruction.
|
// The Store is triggered even when there are no Gateways associated to the |
|
// GatewayClass. This would happen in case the last Gateway is removed and the |
|
// Store will be required to trigger a cleanup of envoy infra resources. |
|
r.resources.GatewayAPIResources.Store(acceptedGC.Name, resourceTree) |
|
func (r *Runner) subscribeAndTranslate(ctx context.Context) { |
|
message.HandleSubscription(r.ProviderResources.GatewayAPIResources.Subscribe(ctx), |
|
func(update message.Update[string, *gatewayapi.Resources]) { |
|
val := update.Value |
|
|
|
if update.Delete || val == nil { |
|
return |
|
} |
|
|
|
// Translate and publish IRs. |
|
t := &gatewayapi.Translator{ |
|
GatewayControllerName: r.Server.EnvoyGateway.Gateway.ControllerName, |
|
GatewayClassName: v1beta1.ObjectName(update.Key), |
|
GlobalRateLimitEnabled: r.EnvoyGateway.RateLimit != nil, |
|
} |
|
|
These are actually unnecessary. Is it possible to separate watch for related resources or separate store and subscribe when resources really change?
like this:
if val, ok := r.resources.GatewayAPIHTTPRoutesResources.Load(acceptedGC.Name); !ok || cmp.Diff(val, httpRoutes) != "" {
r.resources.GatewayAPIHTTPRoutesResources.Store(acceptedGC.Name, httpRoutes)
}
Version
the main branch
Resources Settings
limits: memory 1Gi, CPU 500m
Platform
Openshift
Description:
The current EG implementation watches a lot of resources, such as HTTPRoute, GPCRoute, EnvoyProxy, etc., and a copy of these resources will be reserved in the EG memory, causing the EG memory usage to be very high. When the user's HTTPRoute and other resources continue to increase, the memory of EG will take up more, and the user needs to adjust the resource limits dynamically ?
When any resource changes, EG will trigger the behavior of these changes, such as translation and infrastructure reconstruction.
gateway/internal/provider/kubernetes/controller.go
Lines 287 to 290 in 6af516d
gateway/internal/gatewayapi/runner/runner.go
Lines 51 to 66 in 6af516d
These are actually unnecessary. Is it possible to separate watch for related resources or separate store and subscribe when resources really change?
like this: