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

Create preStop sentinal file for web deployments #774

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/posthog/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 30.30.0
version: 30.31.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
6 changes: 3 additions & 3 deletions charts/posthog/templates/_snippet-web-deployments.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ lifecycle:
exec:
command: [
"sh", "-c",
"(echo '{\"event\": \"preStop_started\"}'; sleep 10; echo '{\"event\": \"preStop_ended\"}') > /proc/1/fd/1"
"(echo '{\"event\": \"preStop_started\"}'; touch /tmp/posthog_prestop || true; sleep 20; echo '{\"event\": \"preStop_ended\"}') > /proc/1/fd/1"
]
{{- end -}}


{{/*

Set a grace period that is 10 seconds delay (from
Set a grace period that is 20 seconds delay (from
lifecycle.exec.preStop) + 30 seconds for Gunicorn to gracefully shutdown
+ 5 seconds leeway

*/}}
{{- define "snippet.web-deployments.terminationGracePeriodSeconds" -}}
45
55
{{- end -}}
2 changes: 1 addition & 1 deletion charts/posthog/tests/web-deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ tests:
asserts:
- equal:
path: spec.template.spec.terminationGracePeriodSeconds
value: 45
value: 55
- isNotNull:
path: spec.template.spec.containers[0].lifecycle
Loading