-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set connect_timeout? #905
Comments
and then i delete the annotations: |
And I get service detail: {
"client_certificate": null,
"connect_timeout": 3000000,
"created_at": 1602484991,
"host": "ci-webconsole-server.ci.8080.svc",
"id": "be9e324b-0d96-519a-84bd-b559e17abc68",
"name": "ci.ci-webconsole-server.8080",
"path": "/",
"port": 80,
"protocol": "http",
"read_timeout": 3000000,
"retries": 5,
"tags": null,
"updated_at": 1602484991,
"write_timeout": 3000000
} But my websocket connection still make a 60s connection. |
Hey @NICK-DUAN, |
I used websocket to make a web terminal, before I create I don't know why and I am replacing the network environment to verify that the network environment is not the cause of the problem. I will keep update. |
I am seeing a similar issue. Even after verifying that the service timeouts are set to kong-ingress-controller:0.9.1 |
I changed my environment, and the result not changed, the websocket connection still close after 60s. Sorry to forget to tell you the version: |
Hi @NICK-DUAN , we had a similar issue today. If your deployment is in AWS you should check your ELB idle timeout setting (By default is 60 seconds) Hope it helps |
Thanks marianopw. But my Deployment was in TKE(Tencent Kubernetes Engine), So could you tell me what ELB idle exactly is? And I can find a same thing in TKE which can help me to resolve my problem? |
ELB stands for elastic load balancer.
You might have another load balancer, or something else in front of kong that is terminating your connection.
(Outside kubernetes).
…On Tue, Oct 20, 2020 at 03:16, Nick_Duan ***@***.***> wrote:
> Hi ***@***.***(https://github.com/NICK-DUAN) , we had a similar issue today.
>
> If your deployment is in AWS you should check your ELB idle timeout setting (By default is 60 seconds)
> After changing this the issue was resolved.
>
> Hope it helps
My Deployment was in TKE(Tencent Kubernetes Engine), So could you tell me what ELB idle exactly is? And I can find a same thing in TKE which can help me to resolve my problem?
—
You are receiving this because you commented.
Reply to this email directly, [view it on GitHub](#905 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ADGY2Y33UDH4PR2FBSM4RRDSLUTM7ANCNFSM4SMFUJ4Q).
|
I konw what the problem is. This code should add to a Service instead of a Ingress: annotations:
konghq.com/override: $YOUR_KONGINGRESS_NAME And your kongIngress should set like this: kind: KongIngress
apiVersion: configuration.konghq.com/v1
metadata:
annotations:
kubernetes.io/ingress.class: "kong"
name: timeout-kong-ingress
proxy:
protocol: http
connect_timeout: 360000 # ms
read_timeout: 360000
write_timeout: 360000 And you also need a Ingress to route your request. The whole file is: apiVersion: apps/v1
kind: Deployment
metadata:
name: websocket
spec:
selector:
matchLabels:
app: websocket
template:
metadata:
labels:
app: websocket
spec:
containers:
- name: websocket
image: ksdn117/web-socket-test
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 8010
---
apiVersion: v1
kind: Service
metadata:
name: websocket
annotations:
konghq.com/override: timeout-kong-ingress
spec:
selector:
app: websocket
ports:
- port: 80
targetPort: 8010
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test2
annotations:
kubernetes.io/ingress.class: "kong"
# konghq.com/strip_path: "true"
spec:
rules:
- http:
paths:
- path: /api/ws/test
backend:
serviceName: websocket
servicePort: 80
---
kind: KongIngress
apiVersion: configuration.konghq.com/v1
metadata:
annotations:
kubernetes.io/ingress.class: "kong"
name: timeout-kong-ingress
proxy:
protocol: http
connect_timeout: 360000
read_timeout: 360000
write_timeout: 360000 |
superb! @NICK-DUAN that helped! thank you. this was not obvious anyway)) |
Kong default connect_timeout, read_timeout, write_timeout are 6,000, but it's not long enough with use a websocket connection, so I want to set a custom value. follow these issue: #354 #472 , but the way they did it's not work for me, so can you point out my problem?
The text was updated successfully, but these errors were encountered: