gpt4 book ai didi

kubernetes - 通过注释增加 traefik 入口超时设置

转载 作者:行者123 更新时间:2023-12-04 17:27:18 30 4
gpt4 key购买 nike

我需要增加我的 traefik 入口超时,因为现在我收到 499 错误。

当我使用 Nginx 作为我的入口代理时能够使用这些注释:

appVersion: ..
kind: Ingress
...
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-connect-timeout: "123"
nginx.ingress.kubernetes.io/proxy-read-timeout: "456"
nginx.ingress.kubernetes.io/proxy-send-timeout: "789"

但现在我正在努力寻找在 Traefik 中做的替代方案。

那么增加我的入口读取、写入、连接值的注释是什么?

最佳答案

如果我没记错的话,您正在寻找当前不存在的功能,但我找到了一个合适的功能请求:Feature: Timeout override per backend #3027 .

自2018年3月15日起处于开放状态。

但是在同一主题中,我发现了对您来说很有趣的新信息:

it is now possible to configure timeouts for each entrypoint in v2

https://docs.traefik.io/routing/entrypoints/#transport

所以请引用Transport部分以获取最新信息并不时查看上述功能请求。

respondingTimeouts¶ respondingTimeouts are timeouts for incoming requests to the Traefik instance. Setting them has no effect for UDP entryPoints.

1) transport.respondingTimeouts.readTimeout

可选,默认=0s

readTimeout 是读取整个请求(包括正文)的最长持续时间。

如果为零,则不存在超时。可以以 time.ParseDuration 支持的格式或作为原始值(数字)提供。如果未提供任何单位,则假定以秒为单位解析该值。

## Static configuration
entryPoints:
name:
address: ":8888"
transport:
respondingTimeouts:
readTimeout: 42

2) transport.respondingTimeouts.writeTimeout

可选,默认=0s

writeTimeout 是响应写入超时之前的最长持续时间。

涵盖从请求头读取结束到响应写入结束的时间。如果为零,则不存在超时。可以以 time.ParseDuration 支持的格式或作为原始值(数字)提供。如果未提供任何单位,则假定以秒为单位解析该值。

## Static configuration
entryPoints:
name:
address: ":8888"
transport:
respondingTimeouts:
writeTimeout: 42

3) transport.respondingTimeouts.idleTimeout

可选,默认=180s

idleTimeout 是空闲(保持事件)连接在关闭自身之前保持空闲的最长时间。

如果为零,则不存在超时。可以以 time.ParseDuration 支持的格式或作为原始值(数字)提供。如果未提供任何单位,则假定以秒为单位解析该值。

## Static configuration
entryPoints:
name:
address: ":8888"
transport:
respondingTimeouts:
idleTimeout: 42

希望对你有帮助

关于kubernetes - 通过注释增加 traefik 入口超时设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62449250/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com