1
我試圖在谷歌雲容器引擎中使用入口HTTP(s)負載均衡器代理websocket。正確連接建立和數據讀取。但30秒後連接超時。 Google文檔(https://cloud.google.com/compute/docs/load-balancing/http/)說要更改超時值(API中的timeoutSec)在Google雲中增加websocket超時Ingress HTTP(S)加載禁止者
但是找不到合適的方法來執行此操作。我用谷歌雲控制檯試了一下。有沒有辦法在.yaml文件中設置websocket超時。
這是我的入口控制器。
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」是websocket服務。
客戶端是javascript。
$scope.webSocket=new WebSocket("ws://"+ location.host"+"/streaming/test");
$scope.webSocket.onopen = function() {
console.log("CONNECTED");
};
在此先感謝。