Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

第 33 章 配置路由超时

安装 OpenShift Container Platform 并部署路由器后,您可以在需要低超时的服务(满足服务级别可用性(SLA)目的或高超时)的情况下,为现有路由配置默认超时。

使用 oc annotate 命令,为路由添加超时:

# oc annotate route <route_name> \
    --overwrite haproxy.router.openshift.io/timeout=<timeout><time_unit>

例如,将名为 myroute 的路由设置为 2 秒的超时:

# oc annotate route myroute --overwrite haproxy.router.openshift.io/timeout=2s

支持的时间单位是微秒 (us)、毫秒 (ms)、秒钟 (s)、分钟 (m)、小时 (h)、或天 (d)。