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

connect: deployments should wait for Connect sidecar checks #19334

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

tgross
Copy link
Member

@tgross tgross commented Dec 6, 2023

When a Connect service is registered with Consul, Nomad includes the nested Connect.SidecarService field that includes health checks for the Envoy proxy. Because these are not part of the job spec, the alloc health tracker created by health_hook doesn't know to read the value of these checks.

In many circumstances this won't be noticed, but if the Envoy health check happens to take longer than the update.min_healthy_time (perhaps because it's been set low), it's possible for a deployment to progress too early such that there will briefly be no healthy instances of the service available in Consul.

Update the Consul service client to find the nested sidecar service in the service catalog and attach it to the results provided to the tracker. The tracker can then check the sidecar health checks.

Fixes: #19269

@tgross tgross added this to the 1.7.x milestone Dec 6, 2023
When a Connect service is registered with Consul, Nomad includes the nested
`Connect.SidecarService` field that includes health checks for the Envoy
proxy. Because these are not part of the job spec, the alloc health tracker
created by `health_hook` doesn't know to read the value of these checks.

In many circumstances this won't be noticed, but if the Envoy health check
happens to take longer than the `update.min_healthy_time` (perhaps because it's
been set low), it's possible for a deployment to progress too early such that
there will briefly be no healthy instances of the service available in Consul.

Update the Consul service client to find the nested sidecar service in the
service catalog and attach it to the results provided to the tracker. The
tracker can then check the sidecar health checks.

Fixes: #19269
Copy link
Member

@gulducat gulducat left a comment

Choose a reason for hiding this comment

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

one lil suggestion, but either way, LGTM!

command/agent/consul/service_client.go Outdated Show resolved Hide resolved
@tgross tgross merged commit 3c4e200 into main Dec 6, 2023
19 checks passed
@tgross tgross deleted the b-gh19269-sidecar-checks branch December 6, 2023 21:59
@tgross
Copy link
Member Author

tgross commented Dec 6, 2023

I'll add the backport labels on this once 1.7.0 GA goes out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line theme/consul/connect Consul Connect integration theme/consul type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nomad allochealth doesn't wait for injected Connect sidecar checks
2 participants