-
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(kuma-cp) dataplane use advertise address to add a routable ip if address is not public ip #2116
feat(kuma-cp) dataplane use advertise address to add a routable ip if address is not public ip #2116
Conversation
…know the public routable address to reach the dataplane in cases where address is not reachable. Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
…oy/kuma into feat/advertise-address
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
api/mesh/v1alpha1/dataplane.proto
Outdated
@@ -46,6 +46,10 @@ message Dataplane { | |||
// Public IP on which the dataplane is accessible in the network. | |||
string address = 5; | |||
|
|||
// AdvertiseAddress is the public routable address for the DP in case | |||
// address is not routable; envoy binds to address | |||
string advertiseAddress = 7; |
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.
Can you explain this more? The "address" field is documented as being publicly accessible, so if this is the real publicly accessible IP, that implies that "address" is set wrong. If there's 2 different publicly accessible addresses, then can there be more than 2? Do certain clients need to pick specific addresses sometime?
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.
Hi @jpeach , yes there could be cases where part of the micro-service is running in an overlay network. Address will be allocated from the overlay n/w. Other data-plane will not be able to connect to these data-plane.
For these cases, we may want to add another advertise address so that other data-plane can connect to this advertise address and there will be additional mapping done to patch advertise address with address.
ex: docker application running in a private network on a VM.
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.
So some DPs will connect to address
and others will connect to advertiseAddress
? How does any DP know which one to use?
The explanation of what this field is for and how it changes the behavior of the system needs to go somewhere, preferably i a long block comment above the field.
I expect we can come up with a better name than "advertiseAddress", which sounds like a command rather than a description. Maybe "externalAddress" or "secondaryAddress"?
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.
Hi @jpeach dp will always bind to address and advertise address will take precedence in case advertise address is provided. I will add a block comment for this section.
For renaming, should we choose external address because secondary address might confuse user. let me know your opinion I will change it accordingly.
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.
@jpeach Let me know if i should rename this variable to externalAddress
@jakubdyszkiewicz
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 like adverisitedAddress
name because it's consistent with ZoneIngress.
If we were to change this, I think we should do it for both resources.
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.
Hi @jpeach dp will always bind to address and advertise address will take precedence in case advertise address is provided. I will add a block comment for this section.
So you only ever bind to one of the two addresses?
Hi @jpeach , DP always bind to address, advertiseAddress is just to update the service entry for this DP in the control plane.
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 like
adverisitedAddress
name because it's consistent with ZoneIngress.
If we were to change this, I think we should do it for both resources.
Hi @jakubdyszkiewicz , yes that is why this name was choose.
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.
@jpeach @jakubdyszkiewicz Let me know your thoughts on this. I will make changes accordingly.
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 should be advertisedAddress
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
api/mesh/v1alpha1/dataplane.proto
Outdated
@@ -46,6 +46,10 @@ message Dataplane { | |||
// Public IP on which the dataplane is accessible in the network. | |||
string address = 5; | |||
|
|||
// AdvertiseAddress is the public routable address for the DP in case | |||
// address is not routable; envoy binds to address | |||
string advertiseAddress = 7; |
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 should be advertisedAddress
api/mesh/v1alpha1/dataplane.proto
Outdated
@@ -46,6 +46,10 @@ message Dataplane { | |||
// Public IP on which the dataplane is accessible in the network. | |||
string address = 5; | |||
|
|||
// AdvertiseAddress is the public routable address for the DP in case | |||
// address is not routable; envoy binds to address |
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.
but Envoy binds to the address
not advertisedAddress
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.
Hey, @sudeeptoroy I'm sorry this PR did not land in Kuma 1.2.0. This contribution should have been included.
I also needed more time to test the PR.
There is a "typo" in the field and misleading comment but other than that it works as expected.We can include this release on release branch and release it in 1.2.1
Thanks for testing this @jakubdyszkiewicz
I will make the changes you mentioned.
There is another suggestion i need.
The code has a function GetIP(). I think this needs to be changed to so that prom can query advertise address if configured.
This will lead to 3 additional changes and hence the question.
1. pkg/envoy/admin/client.go ---> should this use address or advertise address?
2. pkg/mads/util.go. --> this should use advertise address if configured.
3. pkg/xds/envoy/listeners/v3/access_log_configurer.go -> this should use advertise address if configured.
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.
All of those 3 can use AdvertisedAddress, so we should change GetIP() to return AdvertisedAddress if it is set
Hey, @sudeeptoroy I'm sorry this PR did not land in Kuma 1.2.0. This contribution should have been included. We can include this release on release branch and release it in 1.2.1 |
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2116 +/- ##
===========================================
- Coverage 51.68% 15.34% -36.34%
===========================================
Files 899 45 -854
Lines 40752 6327 -34425
===========================================
- Hits 21061 971 -20090
+ Misses 17672 5274 -12398
+ Partials 2019 82 -1937
Continue to review full report at Codecov.
|
… address is not public ip (#2116) Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
advertise address can be used to let the control plane know the public routable address to reach the dataplane in cases where address is not reachable. ex: overlay n/w
Signed-off-by: Sudeepto Roy sudeepto.roy@gmail.com
Fix #1961