istio: Unable to connect to nats from an istio (1.7.1) enabled namespace
Bug description
I am trying to connect to nats
from a namespace where istio (and mTLS) is enabled.
I am consistently getting i/o timeout
error.
Connecting directly to the POD IP works fine.
[ ] Docs [ ] Installation [x] Networking [ ] Performance and Scalability [ ] Extensions and Telemetry [ ] Security [ ] Test and Release [x] User Experience [ ] Developer Infrastructure
Expected behavior
I should be able to connect to nats
service from a namespace where istio is enabled.
Steps to reproduce the bug
- Create
nats.yaml
with the following values:
- Feel free to change the namespace and make sure istio is not enabled on the namespace.
apiVersion: v1
kind: Service
metadata:
labels:
app: nats
name: nats
namespace: "default"
spec:
type: ClusterIP
ports:
- port: 4222
protocol: TCP
name: clients
selector:
app: nats
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nats
name: nats
namespace: "default"
spec:
replicas: 1
selector:
matchLabels:
app: nats
template:
metadata:
labels:
app: nats
spec:
containers:
- name: nats
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 50m
memory: 64Mi
image: nats-streaming:0.17.0
imagePullPolicy: Always
ports:
- containerPort: 4222
protocol: TCP
command: ["/nats-streaming-server"]
args:
- --store
- memory
- --cluster_id
- nats-cluster
- Deploy
nats
kubectl apply -f ./nats.yaml
- Notice connectivity from non-istio namespace is working fine:
$ kubectl run -i --rm --tty ubuntu --image=ubuntu --restart=Never -n default
# in the ubuntu pod, execute the following:
$ apt-get update
$ apt-get install curl zip -y
$ curl -L https://github.com/nats-io/go-nats-examples/releases/download/0.0.50/go-nats-examples-v0.0.50-linux-amd64.zip -o nats.zip
$ unzip nats.zip
$ cd go-nats-examples-v0.0.50-linux-amd64/
$ ./nats-sub -s nats://nats.default.svc.cluster.local:4222 ">"
Listening on [>]
- Notice connectivity from istio-enabled namespace is not working:
$ kubectl run -i --rm --tty ubuntu --image=ubuntu --restart=Never -n istio-enabled-ns
# in the ubuntu pod, execute the following:
$ apt-get update
$ apt-get install curl zip -y
$ curl -L https://github.com/nats-io/go-nats-examples/releases/download/0.0.50/go-nats-examples-v0.0.50-linux-amd64.zip -o nats.zip
$ unzip nats.zip
$ cd go-nats-examples-v0.0.50-linux-amd64/
$ ./nats-sub -s nats://nats.default.svc.cluster.local:4222 ">"
read tcp 10.10.32.123:57612->10.10.10.87:4222: i/o timeout
Version
$ istioctl version --remote
client version: 1.7.4
control plane version: 1.7.1
data plane version: 1.7.1 (14 proxies)
$ kubectl version --short
Client Version: v1.19.2
Server Version: v1.17.11
How was Istio installed?
Using rancher-istio
.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (9 by maintainers)
Commits related to this issue
- 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/iss... — committed to antoniomo/argo-events by antoniomo 3 years ago
- 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/iss... — committed to antoniomo/argo-events by antoniomo 3 years ago
- fix(eventbus): allow clients with istio sidecar. Fixes: #1311 (#1312) Istio-related issues affecting this behaviour: - https://github.com/nats-io/nats-operator/issues/88 - https://github.com/isti... — committed to argoproj/argo-events by antoniomo 3 years ago
- fix(eventbus): allow clients with istio sidecar. Fixes: #1311 (#1312) Istio-related issues affecting this behaviour: - https://github.com/nats-io/nats-operator/issues/88 - https://github.com/isti... — committed to juliev0/argo-events by antoniomo 3 years ago
- Fixing the issue where the services where not able to connect to nats streaming service, was due to port naming issue in nats svc. Refer: https://github.com/istio/istio/issues/28623 — committed to AgathEmmanuel/RentIt by AgathEmmanuel 2 years ago
Most upvoted comments
+3
hzxuzhonghu on Nov 22, 2020