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

Backport of proxy-lifecycle: add HTTP Server with endpoints for proxy lifecycle shutdown into release/1.0.x #180

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #115 to be assessed for backporting due to the inclusion of the label backport/1.0.

WARNING automatic cherry-pick of commits failed. Commits will require human attention.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul-dataplane/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


Refs hashicorp/consul-k8s#536, hashicorp/consul-k8s#650

Adds a proxy lifecycle management server and starts it from the consul-dataplane main process. This server exposes an HTTP endpoint (configurable, defaulting to /graceful_shutdown on port 20300) to optionally start draining inbound (external) connections to the managed Envoy proxy, while allowing outbound requests from the application for which this proxy is acting as a sidecar to continue, up to a configurable grace period timeout, to facilitate application shutdown.

Refactors the envoy package proxy manager to introduce new states (stateDraining and stateExited) and new methods (Drain(), Quit() and renaming Stop() to Kill() to avoid confusion and better describe the actual implementation) and implement an interface to allow a mock implementation for testing the lifecycle management server in isolation.

Notes for reviewers

  • This behavior can currently only be triggered by calling the /graceful_shutdown endpoint explicitly (which will be necessary for handling job termination from a preStop hook) in the future.
  • The additional functionality added to the envoy package does not have proper test coverage yet - I'm hoping to add this as a followup by replacing the current fake-envoy implementation with a Go-based version to include an HTTP server mocking the /drain_listeners and /quitquitquit Envoy admin API endpoints.
  • Should bootstrap tests be added for the Envoy drain time and strategy passthrough configuration?
  • envoyExtraArgs refactor will likely conflict with fix: log level present in extra args using envoy-extra-args annotation : NET-2190 #133 and need to be resolved

Links


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/proxy-lcm/shutdown-http-endpoints/subtly-informed-hagfish branch 2 times, most recently from e7ece30 to c0663b9 Compare June 27, 2023 14:59
@curtbushko
Copy link
Contributor

Going to do this manually.

@curtbushko curtbushko closed this Jun 27, 2023
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