-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable HPA for Envoy Proxy introduce unexpected behavior #2807
Comments
if this is reasonable, I would like to work on this |
looks like we've discussed this a while ago #703 (comment)
|
However @arkodg , it seems to me that unsetting the default replica only addresses the default value behavior, but when a user accidentally sets |
yeah, that is the user being explicit, if the user sets both |
make sense, let me adjust it then |
hi folks @arkodg @zirain , it looks like this issue is still happening, as I observed, it looks like because we are leveraging the Update API instead of Patch API in the infra-client code, below: gateway/internal/infrastructure/kubernetes/infra_client.go Lines 40 to 45 in c655811
Therefore, I tried in my local to change with Patch API, it worked as expected. Should I re-open this issue, or create a new issue? |
yes please open a new issue for this .... |
Description:
Relates to #2257
Once enabled
envoyHpa
on EnvoyProxy API some unexpected behavior was observed.During reconciling, Envoy Gateway managed to create
HorizontalPodAutoscaler
resource successfully. However, when it comes to any operation related to Gateway API resource, Envoy Gateway unexpectedly reset the replicas of Envoy Proxy deployment to their original value specified inEnvoyProxy.spec.provider.kubernetes.envoyDeployment.replicas
, if this field is undefined, then it will set to 1 replica. Though, after some time, when the HPA controller kicks in again, it will set back to itsminReplicas
, but I am a bit concerned in the event of high traffic, and any operation for Gateway API applied, it enforces the Envoy Proxy deployment to be scaled-down.Repro steps:
Apply the below EnvoyProxy manifest, then assuming some of HTTPRoute resources exist, then do any operation such as modification into that resource. You will observe a scale-down operation into EnvoyProxy deployment, from 3 replicas (specified in HPA's
minReplicas
field) to 1 replica (default value for EnvoyProxy replica).Proposal:
Even though the code has already been set up to prevent reverting replicas to their original value when the HPA controller kicks in (to adjust the Envoy Proxy deployment replicas), the Envoy Gateway seems still not aware when it comes in
createOrUpdateDeployment
function during reconciliation.gateway/internal/infrastructure/kubernetes/infra_resource.go
Lines 66 to 86 in af72b32
The
createOrUpdateDeployment
function seems reset the replicas fromdeploymentConfig
in L239,gateway/internal/infrastructure/kubernetes/proxy/resource_provider.go
Lines 238 to 240 in af72b32
It seems to me that we need to set the replicas to nil if
envoyHpa
is utilized, something like below:This way the Envoy Gateway would refrain from further replica adjustments when
envoyHpa
is utilized.Environment:
latest
Logs:
The text was updated successfully, but these errors were encountered: