Ingress 响应超时504故障排除
1. 故障现象:
在阿里云的ACK新上了一套系统.该系统有个将查询结果导出为excle并下载的功能,当第一次下载时等待1分钟后就跳出504,点击返回后再次下载可以正常下载.
2. 分析判断
- 根据504的页面应该是和Ingress配置相关
- 和超时时间长短有关
3. 排除过程
编辑Ingress
bash
kubectl edit ingress/ehelp-ingress -n crm-web
在annotations下追加3行配置
yaml
nginx.ingress.kubernetes.io/proxy-connect-timeout: "600"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
具体如下:
yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"networking.k8s.io/v1","kind":"Ingress","metadata":{"annotations":{},"name":"crm-web-ingress","namespace":"crm-web"},"spec":{"rules":[{"host":"crm-web.mircosoft.com","http":{"paths":[{"backend":{"service":{"name":"crm-web","port":{"number":8080}}},"path":"/","pathType":"Prefix"}]}}]}}
nginx.ingress.kubernetes.io/proxy-connect-timeout: "600"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
...略
按esc : x保存退出后,故障排除.