-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat(mads) add support for HTTP long polling #2121
Conversation
@@ -60,8 +59,10 @@ func (s *service) handleDiscovery(req *restful.Request, res *restful.Response) { | |||
|
|||
discoveryReq.TypeUrl = mads_v1.MonitoringAssignmentType | |||
|
|||
ctx, cancel := context.WithTimeout(context.Background(), s.config.FetchTimeout) | |||
defer cancel() | |||
timeout := s.config.DefaultFetchTimeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we decide on a way to specify this client-side, all that is needed is to parse it here and pass it along.
61d3e35
to
9046903
Compare
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
Signed-off-by: austin ce <austin.cawley@gmail.com>
9046903
to
52484d0
Compare
Signed-off-by: austin ce <austin.cawley@gmail.com>
@@ -473,7 +473,7 @@ sdsServer: | |||
"KUMA_API_SERVER_AUTH_ALLOW_FROM_LOCALHOST": "false", | |||
"KUMA_MONITORING_ASSIGNMENT_SERVER_GRPC_PORT": "3333", | |||
"KUMA_MONITORING_ASSIGNMENT_SERVER_PORT": "2222", | |||
"KUMA_MONITORING_ASSIGNMENT_SERVER_FETCH_TIMEOUT": "45s", | |||
"KUMA_MONITORING_ASSIGNMENT_SERVER_DEFAULT_FETCH_TIMEOUT": "45s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need a line in Upgrade.md for this name change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me check, but I don't think this has been included in a release yet. Would we still need one if that is the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, we won't need it if this is a brand new config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed this is not in 1.1.x:
kuma/pkg/config/mads/config.go
Lines 19 to 26 in be98608
// Monitoring Assignment Discovery Service (MADS) server configuration. | |
type MonitoringAssignmentServerConfig struct { | |
// Port of a gRPC server that serves Monitoring Assignment Discovery Service (MADS). | |
GrpcPort uint32 `yaml:"grpcPort" envconfig:"kuma_monitoring_assignment_server_grpc_port"` | |
// Interval for re-generating monitoring assignments for clients connected to the Control Plane. | |
AssignmentRefreshInterval time.Duration `yaml:"assignmentRefreshInterval" envconfig:"kuma_monitoring_assignment_server_assignment_refresh_interval"` | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can merge this. One remark about Configuration renaming that should land in Upgrade.md
Any thoughts on the timeout parameter @nickolaev / @jakubdyszkiewicz? Since the envoy issue is still silent, I would think either:
|
Are you referring to #2121 (comment) ? if yes, I would vote for (2). |
Yes, exactly. Ok, will merge this now and add this addition ASAP today. |
Summary
Adds support for HTTP long polling by making the xds rest server Fetch call block until there is an update, or the operation times out.
Currently, it just uses the configuration to define default timeouts for updates. I've got an open question in envoy
to see if there is a standard way to set this timeout in the REST-JSON spec (see envoyproxy/envoy#16859), but if they
don't get back to us soon we can just add a simple
timeout
query param or request header.This will unblock the native Prometheus SD efforts here: prometheus/prometheus#8844
Full changelog
monitoringAssignmentServer.fetchTimeout
tomonitoringAssignmentServer.defaultFetchTimeout
Issues resolved
n/a
Documentation
n/a – need to finish the Prometheus SD updates before adding docs.
Testing