-
Notifications
You must be signed in to change notification settings - Fork 339
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
fix(kuma-cp) allocate a new VIP for ExternalService host #2302
Conversation
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
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.
some minors, looks good
pkg/dns/outbound.go
Outdated
externalServices []*core_mesh.ExternalServiceResource, | ||
) []*mesh_proto.Dataplane_Networking_Outbound { | ||
type vipEntry struct { | ||
ip string | ||
port uint32 | ||
host bool |
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.
how about EntryType?
if err := json.Unmarshal([]byte(config), &v); err == nil { | ||
return v, nil | ||
} | ||
backwardCompatible := map[string]string{} |
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.
drop the "canonical" backwards compatibility
comment.
@@ -109,6 +110,48 @@ networking: | |||
Expect(stdout).ToNot(ContainSubstring("HTTPS")) | |||
}) | |||
|
|||
It("should route to external-service", func() { |
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 is already such It in this file. Can you add some comments on what is going on in this test?
// given two external services that point to the same hostname but different port
// when access first external service with .mesh
// then
/// when access first external service using hostname
// then
// when access second external service name using .mesh
// then
/// when access second external service using the same hostname as first but with different port
// then
something like that
Signed-off-by: lobkovilya <ilya.lobkov@konghq.com>
Codecov Report
@@ Coverage Diff @@
## master #2302 +/- ##
==========================================
+ Coverage 51.65% 51.94% +0.28%
==========================================
Files 910 914 +4
Lines 41098 41200 +102
==========================================
+ Hits 21229 21401 +172
+ Misses 17833 17733 -100
- Partials 2036 2066 +30
Continue to review full report at Codecov.
|
(cherry picked from commit 90b1c93)
Summary
Kuma allocates VIP on every new service. Every ExternalService represents a single Kuma service. If we have 2 ExternalServices:
Then 2 VIPs will be allocated:
external-service-1: 240.0.0.1, external-service-2: 240.0.0.2
.It will work fine while we consume services using
.mesh
domain. But if we'd like to consume services usinghost.com
. Built-in DNS feature will resolvehost.com
either to240.0.0.1
or240.0.0.2
, so one of the services won't work properly.Current PR introduces a new type of entry - host entry. Alongside service entries, Kuma will allocate
host.com: 240.0.0.3
.Full changelog
Issues resolved
Fix #2176
Documentation
Testing