Skip to content
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

[v2.4] Port commits from PR #4488 #4514

Merged
merged 4 commits into from
Sep 15, 2022
Merged

Conversation

haq204
Copy link

@haq204 haq204 commented Sep 15, 2022

Description

Cherry-pick from #4488

091be77 updates 2.4 release notes

Related Issues

N/A

Testing

CI

Checklist

  • I made sure to update CHANGELOG.md.

    Remember, the CHANGELOG needs to mention:

    • Any new features
    • Any changes to our included version of Envoy
    • Any non-backward-compatible changes
    • Any deprecations
  • This is unlikely to impact how Ambassador performs at scale.

    Remember, things that might have an impact at scale include:

    • Any significant changes in memory use that might require adjusting the memory limits
    • Any significant changes in CPU use that might require adjusting the CPU limits
    • Anything that might change how many replicas users should use
    • Changes that impact data-plane latency/scalability
  • My change is adequately tested.

    Remember when considering testing:

    • Your change needs to be specifically covered by tests.
      • Tests need to cover all the states where your change is relevant: for example, if you add a behavior that can be enabled or disabled, you'll need tests that cover the enabled case and tests that cover the disabled case. It's not sufficient just to test with the behavior enabled.
    • You also need to make sure that the entire area being changed has adequate test coverage.
      • If existing tests don't actually cover the entire area being changed, add tests.
      • This applies even for aspects of the area that you're not changing – check the test coverage, and improve it if needed!
    • We should lean on the bulk of code being covered by unit tests, but...
    • ... an end-to-end test should cover the integration points
  • I updated DEVELOPING.md with any any special dev tricks I had to use to work on this code efficiently. - N/A

  • The changes in this PR have been reviewed for security concerns and adherence to security best practices.

Hamzah Qudsi added 4 commits September 15, 2022 12:27
TestBootStrapNoNotifyBeforeSync creates ConfigMaps during its tests which doesn't get cleaned up afterwards
potentially infecting other tests. Add t.Cleanup to the test to clean up those ConfigMaps after the test is finished.

Signed-off-by: Hamzah Qudsi <[email protected]>
The Accumulator struct attempts to coalece changes into a single snapshot update as a way to do graceful load shedding.
However, while this was the behavior on bootstrap, it didn't always happen mid-watch - each event that was received turned into a single snapshot update, thus not really satisfying this requirement.

We add a new option to batch changes for a specified window interval before sending a snapshot update.
The batching behavior is as follows:
 - The Accumulator will receive raw changes up until the window period where it will then send a change, even if new updates are still coming in.
   This is to prevent the potential of a scenario where a change is never sent due to an extremely volatile cluster.
   While there may be a way to be more dynamic in how long to wait before sending this change, this approach is simpler and more predicable.

 - If an isolated updated comes in (e.g. last change was submitted an hour ago but the window period is set to 10s), it may not neccessarily wait until the window period before sending change, it can send immediately.

 - The default interval is set to 1s to be inline with current change velocity.

 - A snapshot update won't be sent until all resources are fully bootstrapped, regardless of what interval is set.
   This is the ensure that the other requirements for the Accumulator are still satisfied.

For testing, we add new test cases.

Signed-off-by: Hamzah Qudsi <[email protected]>
AMBASSADOR_RECONFIG_MAX_DELAY controls the interval to wait before sending snapshot updates when listening for K8s resources, especially when many resources are updated in quick succession.

Signed-off-by: Hamzah Qudsi <[email protected]>
Signed-off-by: Hamzah Qudsi <[email protected]>
@haq204 haq204 force-pushed the hqudsi/kates-cherrypick branch from 335b9cf to 091be77 Compare September 15, 2022 17:12
@haq204 haq204 marked this pull request as ready for review September 15, 2022 19:24
@haq204 haq204 requested review from LanceEa and ddymko September 15, 2022 19:24
Copy link
Member

@ddymko ddymko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cherrypicked files - looks good

Copy link
Contributor

@LanceEa LanceEa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@haq204 haq204 merged commit 469f83a into release/v2.4 Sep 15, 2022
@haq204 haq204 deleted the hqudsi/kates-cherrypick branch September 15, 2022 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants