在浏览器下载大文件时,下载大文件超过 1min 会话就被断开,但在浏览器通过 svc:port 下载大文件时就不会超时断开。
报错如下:
查看 Ingress 相关配置,发现并未配置超时相关,所以使用的是默认的 60s。
# kubectl get Ingress cyb -n bigdata-pro -o yaml apiVersion: [networking.k8s.io/v1](http://networking.k8s.io/v1) kind: Ingress metadata: annotations: [nginx.ingress.kubernetes.io/affinity](http://nginx.ingress.kubernetes.io/affinity): cookie [vke.volcengine.com/ingress-type](http://vke.volcengine.com/ingress-type): ingress-nginx creationTimestamp: "2022-11-22T07:15:40Z" generation: 2 managedFields: - apiVersion: [networking.k8s.io/v1beta1](http://networking.k8s.io/v1beta1) fieldsType: FieldsV1 fieldsV1: f:status: f:loadBalancer: f:ingress: {} manager: nginx-ingress-controller operation: Update time: "2022-11-22T07:15:56Z" …………
在产生问题的 Ingress 中增加 Annotations,按需配置超时相关参数的数值。
[nginx.ingress.kubernetes.io/proxy-body-size:](http://nginx.ingress.kubernetes.io/proxy-body-size:) "0" [nginx.ingress.kubernetes.io/proxy-read-timeout:](http://nginx.ingress.kubernetes.io/proxy-read-timeout:) "3600" [nginx.ingress.kubernetes.io/proxy-send-timeout:](http://nginx.ingress.kubernetes.io/proxy-send-timeout:) "3600"