-
Notifications
You must be signed in to change notification settings - Fork 326
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
Update service defaults #502
Conversation
…th checks (#472) remove health checks controller and use endpoints controller for health checks.
- Update the spec of ServiceDefaults and ProxyDefaults to support transparent proxy changes that are introduced as a part of Consul 1.10
9db5a5a
to
cd685e2
Compare
329fc0f
to
a73c9b0
Compare
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.
👍🏽
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.
This looks good, Ashwin! The only thing is that I'm not sure that it works because we don't convert UpstreamConfig
in the ToConsul
function. Maybe having a test that sets all possible values of the service default and checks that it was written to Consul would be good as a validation since acceptance tests also don't set these values?
// will be ignored if a discovery chain is active. | ||
EnvoyClusterJSON string `json:"envoyClusterJSON,omitempty"` | ||
// Protocol describes the upstream's service protocol. Valid values are "tcp", | ||
// "http" and "grpc". Anything else is treated as tcp. The enables protocol |
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.
// "http" and "grpc". Anything else is treated as tcp. The enables protocol | |
// "http" and "grpc". Anything else is treated as tcp. This enables protocol |
// PassiveHealthCheck configuration determines how upstream proxy instances will | ||
// be monitored for removal from the load balancing pool. | ||
PassiveHealthCheck *PassiveHealthCheck `json:"passiveHealthCheck,omitempty"` | ||
// MeshGatewayConfig controls how Mesh Gateways are configured and used |
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.
// MeshGatewayConfig controls how Mesh Gateways are configured and used | |
// MeshGatewayConfig controls how Mesh Gateways are configured and used. |
@@ -153,12 +240,20 @@ func (in *ServiceDefaults) Validate(namespacesEnabled bool) error { | |||
var allErrs field.ErrorList |
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.
should ToConsul
function convert UpstreamConfig?
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.
Maybe we should also add a test that sets all possible values set for service defaults and verifies that it gets written to consul.
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.
Yeah..this was definitely a massive oversight by me
@@ -80,16 +80,133 @@ spec: | |||
description: Mode is the mode that should be used for the upstream connection. One of none, local, or remote. | |||
type: string | |||
type: object | |||
mode: | |||
description: 'Mode can be one of "direct" or "transparent". "transparent" represents that inbound and outbound application traffic is being captured and redirected through the proxy. This mode does not enable the traffic redirection itself. Instead it signals Consul to configure Envoy as if traffic is already being redirected. "direct" represents that the proxy''s listeners must be dialed directly by the local application and other proxies. Note: This cannot be set using the CRD and should be set using annotations on the services that are part of the mesh.' |
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.
It's weird that it added another single quote here to the proxy's
and now it's proxy''s
Don't know if there's a way to escape that.
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.
yeah..i poked around and couldnt really find a way to prevent that
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.
ah ok, oh well. Thanks for looking!
@ishustava I completely forgot about to Consul 😞 . The last few changes were all to ensure that things dont get set it Consul that it just slipped my mind. Will fix that up right away!! |
170ff02
to
9747805
Compare
I updated the acceptance test fixture locally with some upstream configs and verified that they got set |
not be set via the CRD
9747805
to
8daac6a
Compare
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.
🎉
@@ -80,16 +80,133 @@ spec: | |||
description: Mode is the mode that should be used for the upstream connection. One of none, local, or remote. | |||
type: string | |||
type: object | |||
mode: | |||
description: 'Mode can be one of "direct" or "transparent". "transparent" represents that inbound and outbound application traffic is being captured and redirected through the proxy. This mode does not enable the traffic redirection itself. Instead it signals Consul to configure Envoy as if traffic is already being redirected. "direct" represents that the proxy''s listeners must be dialed directly by the local application and other proxies. Note: This cannot be set using the CRD and should be set using annotations on the services that are part of the mesh.' |
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.
ah ok, oh well. Thanks for looking!
Changes proposed in this PR:
Add support for
Mode
andUpstreamConfigs
to Service Defaults.Error out in validation if
Mode
is set as we expect users to use annotations for the sameHow I've tested this PR:
How I expect reviewers to test this PR:
Checklist: