Skip to content
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

revert(kuma-cp): do not use additional addresses (backport of #11601) #11610

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/xds/generator/outbound_proxy_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import (
core_mesh "github.com/kumahq/kuma/pkg/core/resources/apis/mesh"
"github.com/kumahq/kuma/pkg/core/user"
model "github.com/kumahq/kuma/pkg/core/xds"
<<<<<<< HEAD
"github.com/kumahq/kuma/pkg/plugins/policies/meshhttproute/api/v1alpha1"
=======
util_protocol "github.com/kumahq/kuma/pkg/util/protocol"
>>>>>>> 205997054 (revert(kuma-cp): do not use additional addresses (#11601))
xds_context "github.com/kumahq/kuma/pkg/xds/context"
envoy_common "github.com/kumahq/kuma/pkg/xds/envoy"
envoy_clusters "github.com/kumahq/kuma/pkg/xds/envoy/clusters"
Expand Down Expand Up @@ -47,7 +51,11 @@ func (g OutboundProxyGenerator) Generate(ctx context.Context, xdsCtx xds_context
for _, outbound := range outbounds {
// Determine the list of destination subsets
// For one outbound listener it may contain many subsets (ex. TrafficRoute to many destinations)
<<<<<<< HEAD
routes := g.determineRoutes(proxy, outbound, clusterCache, xdsCtx.Mesh.Resource.ZoneEgressEnabled())
=======
routes := g.determineRoutes(proxy, proxy.Dataplane.Spec.Networking.ToOutboundInterface(outbound), clusterCache, xdsCtx.Mesh.Resource.ZoneEgressEnabled())
>>>>>>> 205997054 (revert(kuma-cp): do not use additional addresses (#11601))
clusters := routes.Clusters()

protocol := InferProtocol(proxy, clusters)
Expand Down
135 changes: 135 additions & 0 deletions pkg/xds/generator/testdata/outbound-proxy/10.envoy.golden.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
resources:
- name: backend
resource:
'@type': type.googleapis.com/envoy.config.cluster.v3.Cluster
connectTimeout: 5s
edsClusterConfig:
edsConfig:
ads: {}
resourceApiVersion: V3
lbPolicy: MAGLEV
name: backend
transportSocket:
name: envoy.transport_sockets.tls
typedConfig:
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
commonTlsContext:
alpnProtocols:
- kuma
combinedValidationContext:
defaultValidationContext:
matchTypedSubjectAltNames:
- matcher:
exact: spiffe://mesh1/backend
sanType: URI
validationContextSdsSecretConfig:
name: mesh_ca:secret:mesh1
sdsConfig:
ads: {}
resourceApiVersion: V3
tlsCertificateSdsSecretConfigs:
- name: identity_cert:secret:mesh1
sdsConfig:
ads: {}
resourceApiVersion: V3
sni: backend{mesh=mesh1}
type: EDS
typedExtensionProtocolOptions:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicitHttpConfig:
http2ProtocolOptions: {}
- name: backend
resource:
'@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
clusterName: backend
endpoints:
- lbEndpoints:
- endpoint:
address:
socketAddress:
address: 192.168.0.1
portValue: 8081
loadBalancingWeight: 1
metadata:
filterMetadata:
envoy.lb:
region: us
envoy.transport_socket_match:
region: us
- endpoint:
address:
socketAddress:
address: 192.168.0.2
portValue: 8082
loadBalancingWeight: 1
- name: outbound:127.0.0.1:18080
resource:
'@type': type.googleapis.com/envoy.config.listener.v3.Listener
address:
socketAddress:
address: 127.0.0.1
portValue: 18080
bindToPort: false
filterChains:
- filters:
- name: envoy.filters.network.tcp_proxy
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
cluster: backend
idleTimeout: 0s
statPrefix: backend
metadata:
filterMetadata:
io.kuma.tags:
kuma.io/service: backend
name: outbound:127.0.0.1:18080
trafficDirection: OUTBOUND
- name: outbound:240.0.0.3:80
resource:
'@type': type.googleapis.com/envoy.config.listener.v3.Listener
address:
socketAddress:
address: 240.0.0.3
portValue: 80
bindToPort: false
filterChains:
- {}
metadata:
filterMetadata:
io.kuma.tags:
kuma.io/service: backend
name: outbound:240.0.0.3:80
trafficDirection: OUTBOUND
- name: outbound:240.0.0.4:80
resource:
'@type': type.googleapis.com/envoy.config.listener.v3.Listener
address:
socketAddress:
address: 240.0.0.4
portValue: 80
bindToPort: false
filterChains:
- {}
metadata:
filterMetadata:
io.kuma.tags:
kuma.io/service: backend
name: outbound:240.0.0.4:80
trafficDirection: OUTBOUND
- name: outbound:240.0.0.4:8080
resource:
'@type': type.googleapis.com/envoy.config.listener.v3.Listener
address:
socketAddress:
address: 240.0.0.4
portValue: 8080
bindToPort: false
filterChains:
- {}
metadata:
filterMetadata:
io.kuma.tags:
kuma.io/service: backend
name: outbound:240.0.0.4:8080
trafficDirection: OUTBOUND
Loading