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

Support disabling TCP checks for connect sidecar services #10531

Merged
merged 4 commits into from
May 7, 2021

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented May 6, 2021

Alternative to #10524 - that focuses on disabling the default TCP check for sidecar services. It solves the immediate needs without blocking future improvements in the area.

Fixes #9773 .

@notnoop notnoop added this to the 1.1.0 milestone May 6, 2021
@notnoop notnoop requested a review from shoenig May 6, 2021 21:17
@notnoop notnoop self-assigned this May 6, 2021
Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

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

LGTM! Just the two suggestions

},
}
} else {
// insert a NOOP check to avoid Consul inserting the default
Copy link
Member

Choose a reason for hiding this comment

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

This comment is a bit misleading - the aliasing here is functional to consul service discovery - e.g. if the tcp check exists and is failing, queries for the aliased service will not return results including this sidecar (i.e. when using connect upstreams).

Address: cMapping.HostIP,
Proxy: proxy,
Checks: api.AgentServiceChecks{
var checks api.AgentServiceChecks
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: since we're building a slice that will always include the alias, i'd golf this down to

checks := api.ServiceChecks {{
 // .. <alias check>
}}
if !css.DisableDefaultCheck {
 checks = append(checks, <tcp check>)
}

@@ -550,6 +550,7 @@ func parseSidecarService(o *ast.ObjectItem) (*api.ConsulSidecarService, error) {
"port",
"proxy",
"tags",
"disable_default_tcp_check",
Copy link
Member

Choose a reason for hiding this comment

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

backporting to HCL1 isn't required, but also doesn't hurt anything

command/agent/consul/connect.go Outdated Show resolved Hide resolved
Co-authored-by: Seth Hoenig <shoenig@hashicorp.com>
@tgross
Copy link
Member

tgross commented May 7, 2021

Curses, the test is order-dependent. Will fix.

@apollo13
Copy link
Contributor

@notnoop I tried this yesterday and adding disable_default_tcp_check showed an inplace change when planing it. Deploying it then didn't change anything -- do I miss something?

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[question] Is there any way to disable TCP Sidecar Listening Check?
4 participants