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

Clarify graceful startup in the documentation #3220

Closed
ttn-nguyen42 opened this issue Nov 16, 2023 · 2 comments
Closed

Clarify graceful startup in the documentation #3220

ttn-nguyen42 opened this issue Nov 16, 2023 · 2 comments
Labels
type/question Question about product, ideally should be pointed to discuss.hashicorp.com

Comments

@ttn-nguyen42
Copy link

ttn-nguyen42 commented Nov 16, 2023

With consul-k8s 1.2.x and consul-dataplane 1.1.x, the default behaviour for consul.hashicorp.com/enable-sidecar-proxy-lifecycle: "true" is that (sidecar, application) used to start at the same time. This caused users like us to write a startup script for all of our mesh applications to wait for their proxy to work (which would allow external connections to databases, consul KV, etc.) before it would start itself.

With this PR: Dataplane - net 2898, graceful_startup and Consul K8s - Net 1784 inject sidecar first, included in consul-dataplane:1.3.0 and consul-k8s:1.3 the previous problem just disappear. Containers are still being started at the same time, but seems like the application container waited for the sidecar for a little bit before it would run the entrypoint. This seems like the default behaviour of a postStart hook though I couldn't find any reference to this hook anywhere in the repo and the Dataplane repo as well. I would love a quick explanation for this behaviour change.

It would be nice to add this behaviour change in the Consul documentation and explain it a little bit, in the lifecycle-related Helm configs as it might help users from this issue: Consul K8s - Adding support for lifecycle hooks and health probe for sidecars

@ttn-nguyen42 ttn-nguyen42 added the type/question Question about product, ideally should be pointed to discuss.hashicorp.com label Nov 16, 2023
@ttn-nguyen42
Copy link
Author

ttn-nguyen42 commented Nov 16, 2023

My mistake, the issue never went away, it's probably because Kubernetes single threaded container startup sequence starts the proxy first before the service (due to the lifecycle annotation) and that causes a delay long enough for the proxy to start itself.

If I set the intention to "*" to make the sidecar starts longer, the issue persists.

Now that Kubernetes' sidecar is available, do we have any plan to support proper sidecar lifecycle?

@ttn-nguyen42 ttn-nguyen42 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2023
@david-yu
Copy link
Contributor

@ttn-nguyen42 This is the issue that is still outstanding: #1397 which would allow for the proxy to wait until the application finishes starting up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question Question about product, ideally should be pointed to discuss.hashicorp.com
Projects
None yet
Development

No branches or pull requests

2 participants