I tried to proxy websocket using ingress HTTP(s) load balancer in google cloud container engine. Connection establishment and data reading properly. But connection timeout after 30 s. Google documentation (https://cloud.google.com/compute/docs/load-balancing/http/) says to change timeout value (timeoutSec in the API)
But cannot found a proper way to do this. I tried it with google cloud console. Is there a way to set timeout to websocket in .yaml file.
This is my ingress controller.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: load-balancer
spec:
rules:
- http:
paths:
- path: /*
backend:
serviceName: dash-board
servicePort: 2020
- path: /auth/*
backend:
serviceName: auth-service
servicePort: 1111
- path: /filter-service/*
backend:
serviceName: filter
servicePort: 8081
- path: /data-service/*
backend:
serviceName: data-service
servicePort: 8090
- path: /streaming/*
backend:
serviceName: streaming
servicePort: 8080
"streaming" is the websocket service.
Client is javascript.
$scope.webSocket=new WebSocket("ws://"+ location.host"+"/streaming/test");
$scope.webSocket.onopen = function () {
console.log("CONNECTED");
};
Thanks in advance.