Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .changelog/2748.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
control-plane: Set locality on sidecar proxies in addition to services when registering with connect-inject.
```
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@ func (r *Controller) createServiceRegistrations(pod corev1.Pod, serviceEndpoints
Namespace: consulNS,
Proxy: proxyConfig,
Tags: tags,
// Sidecar locality (not proxied service locality) is used for locality-aware routing.
Locality: locality,
}

// A user can enable/disable tproxy for an entire namespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,10 @@ func TestReconcileCreateEndpoint(t *testing.T) {
"envoy_telemetry_collector_bind_socket_dir": "/consul/connect-inject",
},
},
ServiceLocality: &api.Locality{
Region: "us-west-1",
Zone: "us-west-1a",
},
ServiceMeta: map[string]string{
"name": "abc",
"version": "2",
Expand Down Expand Up @@ -2225,6 +2229,7 @@ func TestReconcileCreateEndpoint(t *testing.T) {
require.Equal(t, tt.expectedProxySvcInstances[i].ServicePort, instance.ServicePort)
require.Equal(t, tt.expectedProxySvcInstances[i].ServiceMeta, instance.ServiceMeta)
require.Equal(t, tt.expectedProxySvcInstances[i].ServiceTags, instance.ServiceTags)
require.Equal(t, tt.expectedProxySvcInstances[i].ServiceLocality, instance.ServiceLocality)
if tt.nodeMeta != nil {
require.Equal(t, tt.expectedProxySvcInstances[i].NodeMeta, instance.NodeMeta)
}
Expand Down