-
Notifications
You must be signed in to change notification settings - Fork 108
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
Prevent pod scaling if app is the target of an HPA #201
Conversation
071edf0
to
75ce8a5
Compare
internal/api/v1beta1/app_types.go
Outdated
@@ -556,7 +556,7 @@ func (app *App) DoCanary(now metav1.Time, logger logr.Logger, recorder record.Ev | |||
eventStep := newCanaryNextStepEvent(app) | |||
recorder.AnnotatedEventf(app, eventStep.Event.Annotations, v1.EventTypeNormal, eventStep.Event.Name, eventStep.Message()) | |||
|
|||
if app.Spec.Canary.Target != nil { | |||
if app.Spec.Canary.Target != nil && !disableScale { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely will work with shipa because it creates an HPA object for each process of each deployment.
What if an application has two deployments with web
and worker
processes and there is only one HPA targeting the worker
process of the first deployment.
I think we can easily disable scaling per deployment per process.
@stinkyfingers @koncar what do you think guys? I'm OK with the single disableScale
flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with trying to disable per process, but I think either approach works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have implemented a version that will allow for disabling scaling per process. I was having some trouble thinking of a clean way of also being able to limit based on Version.
Something like using a map where the key is the process appended with the deployment version I think would work, but would need some string parsing in the doCanary function. Do we want to have that level of control or leave it at the process level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great!
Description
If there is an HPA for an app, we do not want units to be scaled in canary deployment
Fixes # 2147
Type of change
Testing
Documentation
Final Checklist:
Additional Information (omit if empty)
Please include anything else relevant to this PR that may be useful to know.