mesh: ensure we add the virtual port number for L7 implicit upstreams (#19085)

This commit is contained in:
R.B. Boyer 2023-10-05 17:07:41 -05:00 committed by GitHub
parent 342306c312
commit 754ab9abf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 51 deletions

View File

@ -241,7 +241,7 @@ func (b *Builder) buildDestination(
rb := lb.addL7Router("", effectiveProtocol)
if destination.Explicit == nil {
rb.addIPMatch(destination.VirtualIPs)
rb.addIPAndPortMatch(destination.VirtualIPs, virtualPortNumber)
}
rb.buildRouter()
} else {

View File

@ -222,6 +222,40 @@
]
}
},
{
"l7": {
"name": "outbound_listener",
"statPrefix": "upstream."
},
"match": {
"destinationPort": 8080,
"prefixRanges": [
{
"addressPrefix": "1.1.1.1",
"prefixLen": 32
}
]
}
},
{
"l7": {
"name": "outbound_listener",
"statPrefix": "upstream."
},
"match": {
"destinationPort": 8080,
"prefixRanges": [
{
"addressPrefix": "2.2.2.2",
"prefixLen": 32
},
{
"addressPrefix": "3.3.3.3",
"prefixLen": 32
}
]
}
},
{
"l4": {
"cluster": {
@ -259,38 +293,6 @@
}
]
}
},
{
"l7": {
"name": "outbound_listener",
"statPrefix": "upstream."
},
"match": {
"prefixRanges": [
{
"addressPrefix": "1.1.1.1",
"prefixLen": 32
}
]
}
},
{
"l7": {
"name": "outbound_listener",
"statPrefix": "upstream."
},
"match": {
"prefixRanges": [
{
"addressPrefix": "2.2.2.2",
"prefixLen": 32
},
{
"addressPrefix": "3.3.3.3",
"prefixLen": 32
}
]
}
}
]
}

View File

@ -121,14 +121,12 @@
}
},
{
"l4": {
"cluster": {
"name": "tcp2.api-app.default.dc1.internal.foo.consul"
},
"statPrefix": "upstream.tcp2.api-app.default.default.dc1"
"l7": {
"name": "outbound_listener",
"statPrefix": "upstream."
},
"match": {
"destinationPort": 8081,
"destinationPort": 8080,
"prefixRanges": [
{
"addressPrefix": "1.1.1.1",
@ -138,11 +136,14 @@
}
},
{
"l7": {
"name": "outbound_listener",
"statPrefix": "upstream."
"l4": {
"cluster": {
"name": "tcp2.api-app.default.dc1.internal.foo.consul"
},
"statPrefix": "upstream.tcp2.api-app.default.default.dc1"
},
"match": {
"destinationPort": 8081,
"prefixRanges": [
{
"addressPrefix": "1.1.1.1",

View File

@ -121,14 +121,12 @@
}
},
{
"l4": {
"cluster": {
"name": "tcp2.api-app.default.dc1.internal.foo.consul"
},
"statPrefix": "upstream.tcp2.api-app.default.default.dc1"
"l7": {
"name": "outbound_listener",
"statPrefix": "upstream."
},
"match": {
"destinationPort": 8081,
"destinationPort": 8080,
"prefixRanges": [
{
"addressPrefix": "1.1.1.1",
@ -138,11 +136,14 @@
}
},
{
"l7": {
"name": "outbound_listener",
"statPrefix": "upstream."
"l4": {
"cluster": {
"name": "tcp2.api-app.default.dc1.internal.foo.consul"
},
"statPrefix": "upstream.tcp2.api-app.default.default.dc1"
},
"match": {
"destinationPort": 8081,
"prefixRanges": [
{
"addressPrefix": "1.1.1.1",