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

cmd/contour: refactor shutdown-manager to initiate shutdown using an Exec command #2751

Merged
merged 2 commits into from
Aug 3, 2020

Conversation

stevesloka
Copy link
Member

@stevesloka stevesloka commented Jul 30, 2020

This changes the preStop lifecycle hook to utilize a command instead of an http request. The /shutdown http endpoint now only returns when the pod is ready to be terminated, and no longer initiates the Envoy shutdown sequence.

The Envoy container will block on its preStop hook until the /shutdown endpoint returns. That endpoint, implemented in the shutdown-manager, will utilize a file messaging pattern to know when it is safe for Envoy to terminate by checking for the existence of a file in the filesystem.

Signed-off-by: Steve Sloka slokas@vmware.com

@stevesloka stevesloka added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 30, 2020
@stevesloka stevesloka added this to the 1.7.0 milestone Jul 30, 2020
@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #2751 into master will decrease coverage by 0.24%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2751      +/-   ##
==========================================
- Coverage   77.02%   76.78%   -0.25%     
==========================================
  Files          72       72              
  Lines        5719     5737      +18     
==========================================
  Hits         4405     4405              
- Misses       1226     1244      +18     
  Partials       88       88              
Impacted Files Coverage Δ
cmd/contour/contour.go 4.22% <0.00%> (-0.19%) ⬇️
cmd/contour/shutdownmanager.go 21.05% <0.00%> (-3.95%) ⬇️

@stevesloka stevesloka force-pushed the prestop branch 3 times, most recently from 910a541 to e5ee5e1 Compare July 30, 2020 21:45
…Exec command

This changes the preStop lifecycle hook to utilize a command instead of an http request.
The /shutdown http endpoint now only returns when the pod is ready to be terminated, and
no longer initiates the Envoy shutdown sequence.

The Envoy container will block on its preStop hook until the /shutdown endpoint returns.
That endpoint, implemented in the shutdown-manager, will utilize a file messaging pattern
to know when it is safe for Envoy to terminate by checking for the existence of a file
in the filesystem.

Signed-off-by: Steve Sloka <slokas@vmware.com>
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

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

Couple minor things but otherwise this looks reasonable to me.

cmd/contour/shutdownmanager.go Outdated Show resolved Hide resolved
cmd/contour/shutdownmanager.go Show resolved Hide resolved
Signed-off-by: Steve Sloka <slokas@vmware.com>
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

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

LGTM

@stevesloka stevesloka merged commit 7cd9f4a into projectcontour:master Aug 3, 2020
@stevesloka stevesloka deleted the prestop branch August 3, 2020 17:11
tthebst pushed a commit to tthebst/contour that referenced this pull request Aug 6, 2020
…Exec command (projectcontour#2751)

cmd/contour: refactor shutdown-manager to initiate shutdown using an Exec command

This changes the preStop lifecycle hook to utilize a command instead of an http request.
The /shutdown http endpoint now only returns when the pod is ready to be terminated, and
no longer initiates the Envoy shutdown sequence.

The Envoy container will block on its preStop hook until the /shutdown endpoint returns.
That endpoint, implemented in the shutdown-manager, will utilize a file messaging pattern
to know when it is safe for Envoy to terminate by checking for the existence of a file
in the filesystem.

Signed-off-by: Steve Sloka <slokas@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants