From 2efa113b7c2479db52ebd201859eb06d70961fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20M=2E=20Mac=C3=ADas=20Ojeda?= Date: Sat, 14 Aug 2021 10:45:56 +0300 Subject: [PATCH] fix(eventbus): allow clients with istio sidecar. Fixes: #1311 Istio-related issues affecting this behaviour: - https://github.com/nats-io/nats-operator/issues/88 - https://github.com/istio/istio/issues/28623 The fix is very simple. I added the related issues to the code comment, let me know if that's undesirable or there's something else to clarify. --- controllers/eventbus/installer/nats.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/eventbus/installer/nats.go b/controllers/eventbus/installer/nats.go index 337c1bf0d7..814af13dfa 100644 --- a/controllers/eventbus/installer/nats.go +++ b/controllers/eventbus/installer/nats.go @@ -414,7 +414,11 @@ func (i *natsInstaller) buildStanService() (*corev1.Service, error) { Spec: corev1.ServiceSpec{ ClusterIP: corev1.ClusterIPNone, Ports: []corev1.ServicePort{ - {Name: "client", Port: clientPort}, + // Prefix tcp- to enable clients to connect from + // an istio-enabled namespace, following: + // https://github.com/nats-io/nats-operator/issues/88 + // https://github.com/istio/istio/issues/28623 + {Name: "tcp-client", Port: clientPort}, {Name: "cluster", Port: clusterPort}, {Name: "monitor", Port: monitorPort}, },