-
Notifications
You must be signed in to change notification settings - Fork 25
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
Make generating NotScale events configurable; use logs when disabled #204
Conversation
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 pull request does not contain a valid label. Please add one of the following labels: bug, enhancement, refactoring, documentation, tooling, dependencies
The code LGTM but I don't think we should emit an event ever. Either we emit a debug log or we just update the |
832f671
832f671
to
c8d2c1e
Compare
r.eventRecorder.Eventf(wpa, corev1.EventTypeNormal, datadoghqv1alpha1.ReasonNotScaling, fmt.Sprintf("Decided not to scale %s to %d (last scale time was %v )", reference, desiredReplicas, wpa.Status.LastScaleTime)) | ||
if r.Options.SkipNotScalingEvents { | ||
setCondition(wpa, autoscalingv2.ScalingActive, corev1.ConditionTrue, datadoghqv1alpha1.ConditionReasonNotScaling, "the WPA was able to successfully calculate a replica count and decided not to scale %s to %d (last scale time was %v )", reference, desiredReplicas, wpa.Status.LastScaleTime) | ||
logger.Info(fmt.Sprintf("Decided not to scale %s to %d (last scale time was %v )", reference, desiredReplicas, wpa.Status.LastScaleTime)) |
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 think having the info once in the status is enough. The WPA is already a big logger, could be a debug
log if you want to keep it.
…204) * Make generating NotScale events configurable; use logs when disabled * Adding status update along w/ log line * removed info level log line
What does this PR do?
Add skipNotScalingEvents config option in WPA to disable NotScaling Kubernetes events. When disabled this will generate a log instead and update the
Status
of the WPA.Motivation
Eliminate WPA error logs that are the result of the Kubernetes API server rate limiting WPA event writes
Additional Notes
Status
we use theScalingActive
Condition Type. This is initially set here and we override the condition & message to show that the replicas are correctly calculated, however we are choosing not to scale.Describe your test plan
Decided not to scale
to appear as logs instead.Status
update with a message like the below when not scaling.