Improve consul fingerprinting #10688
Labels
stage/accepted
Confirmed, and intend to work on. No timeline committment though.
theme/fingerprint
type/enhancement
Currently, Nomad agent will fingerprint these attributes about its configured Consul client:
Although whether Consul is enterprise is embedded in
consul.version
as a build meta extension (+ent
), this is insufficient to properly switch on enterprise features, i.e. in the case of Namespace support. This is because Enterprise features may be gated behind licensing, returning an error when querying related endpoints. With how Nomad tries to use namespaces, this currently causes an error:The Consul fingerprint should include all available features on Nomad client startup, so we can proactively avoid hitting endpoint(s) that will just return an error later on.
While we're at it, we can also detect if Consul Connect is enabled, and avoid scheduling Connect tasks on nodes with improperly configured Consul agents. Before using Connect, Consul must be conifgured with
connect.enabled = true
andports.grpc = <non-zero>
.We can detect if connect is enabled with a query to the/v1/agent/self
API and checking for a non-empty*xDS.SupportedProxes
response blob. We can check for the grpc port being open by making a TCP connection to the configuredconsul.grpc_address
(or 8502 if not configured).We can detect if connect is enabled with
.DebugConfig.ConnectEnabled
, and if gRPC is enabled with.DebugConfig.GRPCPort
. Items underDebugConfig
are subject to change, but I suspect these two values are going to be pretty stable...The text was updated successfully, but these errors were encountered: