Hi,
We have a SocketIO app that we want to deploy to our cluster. We’re running on Istio 1.3.5. Whenever I port-forward the service of the socketio app, we were able to connect our client to it. But whenever we try connecting to the domain where its gateway is pointing, it gives us a “WebSocket is closed before the connection is established.”
I’ve seen posts like this where the app fails to maintain a connection when increasing the replica number, but in my case, even with only one pod deployed it still fails to establish a connection. What do you think is the problem of my setup? Below is my code for VS, Gateway and Destination Rule:
Gateway:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: allocator-gateway
namespace: default
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- <domain here>
port:
name: https-allocator
number: 8080
protocol: HTTPS
tls:
credentialName: allocator-cert
mode: SIMPLE
privateKey: sds
serverCertificate: sds
Virtualservice:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: allocator-vs
namespace: default
spec:
gateways:
- allocator-gateway
hosts:
- <domain here>
http:
- match:
- uri:
prefix: /
route:
- destination:
host: abc-allocator
subset: v1
port:
number: 8080
weight: 100
- destination:
host: abc-allocator
subset: v2
port:
number: 8080
weight: 0
websocketUpgrade: true
Destination Rule:
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: allocator-dr
spec:
host: abc-allocator
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
Any help to this will be appreciated. Thanks!