跳转到内容

源池增强

origin_pool 相关模式的丰富元数据。有关扩展定义,请参阅 OpenAPI 扩展

所有匹配 origin_pool.*SpecType 的模式均会接收丰富处理:

  • origin_poolCreateSpecType
  • origin_poolReplaceSpecType
  • origin_poolGetSpecType
字段适用操作备注
metadata.name所有操作1-63 个字符,小写字母数字,模式:^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
metadata.namespace所有操作命名空间标识符
spec.origin_servers创建最少 1 项
spec.port创建1-65535,无服务器默认值
{
"metadata": {
"name": "my-origin-pool",
"namespace": "default"
},
"spec": {
"origin_servers": [
{
"public_name": {
"dns_name": "backend.example.com"
}
}
],
"port": 443
}
}

标记有 x-f5xc-server-default: true 的字段,在请求中省略时,其 default 值将由 F5 XC API 服务器自动应用。

字段默认值类型描述
no_tls{}object到源的 TLS 已禁用
healthcheck[]array未配置健康检查
loadbalancer_algorithmROUND_ROBINenum轮询负载均衡
endpoint_selectionDISTRIBUTEDenum使用所有端点(本地 + 远程)

当未指定 advanced_options 时,服务器的行为如同已设置以下值:

字段默认值类型描述
connection_timeout2000integer连接超时(毫秒)
http_idle_timeout300000integerHTTP 空闲超时(毫秒,5 分钟)
same_as_endpoint_port{}object健康检查使用端点端口
default_circuit_breaker{}object默认熔断器设置
disable_outlier_detection{}object异常点检测已禁用
no_panic_threshold{}object无恐慌阈值
disable_subsets{}object子集负载均衡已禁用
auto_http_config{}object自动 HTTP 协议协商
disable_proxy_protocol{}object代理协议已禁用
disable_lb_source_ip_persistance{}object负载均衡源 IP 持久化已禁用
路径默认值描述
origin_servers[].labels{}空标签对象
origin_servers[].public_name.refresh_interval0使用系统默认 DNS 刷新间隔

F5 XC Web 界面预选的值与省略字段时 API 应用的值不同。

字段UI 预选值服务器应用值备注
loadbalancer_algorithmLB_OVERRIDEROUND_ROBIN省略该字段时,通过 UI 创建和通过 API 创建的资源存在差异
描述备注
ROUND_ROBIN按轮询顺序选择每个健康端点服务器默认值
LEAST_REQUEST选择活跃请求数最少的端点
RING_HASH使用端点名称的环形哈希进行一致性哈希
RANDOM随机选择健康端点
LB_OVERRIDE哈希策略继承自父级负载均衡器UI 默认值
描述备注
DISTRIBUTED同时考虑远程和本地端点服务器默认值
LOCAL_ONLY仅使用本地端点
LOCAL_PREFERRED优先使用本地端点,不可用时回退到远程端点

互斥字段组。每组中只能指定 一个 字段:

字段服务器默认值
端口配置port, automatic_port, lb_portport(显式)
到源的 TLSno_tls, use_tlsno_tls
健康检查端口same_as_endpoint_port, health_check_portsame_as_endpoint_port
熔断器default_circuit_breaker, disable_circuit_breaker, circuit_breakerdefault_circuit_breaker
异常点检测disable_outlier_detection, outlier_detectiondisable_outlier_detection
恐慌阈值no_panic_threshold, panic_thresholdno_panic_threshold
子集负载均衡disable_subsets, enable_subsetsdisable_subsets
HTTP 协议auto_http_config, http1_config, http2_optionsauto_http_config
代理协议disable_proxy_protocol, proxy_protocol_v1, proxy_protocol_v2disable_proxy_protocol
负载均衡源 IPdisable_lb_source_ip_persistance, enable_lb_source_ip_persistancedisable_lb_source_ip_persistance
连接池enable_conn_pool_reuse, disable_conn_pool_reuseenable_conn_pool_reuse
字段类型约束
spec.portinteger1-65535
spec.advanced_options.connection_timeoutinteger0-1,800,000 毫秒
spec.advanced_options.http_idle_timeoutinteger0-600,000 毫秒
spec.advanced_options.panic_thresholdinteger0-100(百分比)
metadata.namestring1-63 个字符,模式:^[a-z0-9]([-a-z0-9]*[a-z0-9])?$

F5 XC Web 控制台为源池提供 15 个配置选项:

#UI 标签API 字段路径类型服务器默认值
1源服务器端口spec.[port|automatic_port|lb_port]OneOfport(显式)
2连接池复用spec.[enable_conn_pool_reuse|disable_conn_pool_reuse]OneOfenable_conn_pool_reuse
3健康检查端口spec.advanced_options.[same_as_endpoint_port|health_check_port]OneOfsame_as_endpoint_port
4负载均衡算法spec.loadbalancer_algorithmenumROUND_ROBIN
5端点选择spec.endpoint_selectionenumDISTRIBUTED
6到源的 TLSspec.[no_tls|use_tls]OneOfno_tls
7连接超时spec.advanced_options.connection_timeoutinteger2000 毫秒
8HTTP 空闲超时spec.advanced_options.http_idle_timeoutinteger300000 毫秒
9熔断器spec.advanced_options.[default_circuit_breaker|disable_circuit_breaker|circuit_breaker]OneOfdefault_circuit_breaker
10异常点检测spec.advanced_options.[disable_outlier_detection|outlier_detection]OneOfdisable_outlier_detection
11恐慌阈值spec.advanced_options.[no_panic_threshold|panic_threshold]OneOfno_panic_threshold
12子集负载均衡spec.advanced_options.[disable_subsets|enable_subsets]OneOfdisable_subsets
13HTTP 协议spec.advanced_options.[auto_http_config|http1_config|http2_options]OneOfauto_http_config
14代理协议spec.advanced_options.[disable_proxy_protocol|proxy_protocol_v1|proxy_protocol_v2]OneOfdisable_proxy_protocol
15负载均衡源 IP 持久化spec.advanced_options.[disable_lb_source_ip_persistance|enable_lb_source_ip_persistance]OneOfdisable_lb_source_ip_persistance
文件内容
docs/specifications/api/virtual.jsonorigin_poolCreateSpecType, origin_poolReplaceSpecType, origin_poolGetSpecType
docs/specifications/api/openapi.json包含所有模式的合并规范
defaults.resources.origin_pool
├── server_applied # 带有 x-f5xc-server-default: true 的字段
├── recommended # 带有 x-f5xc-recommended-value 的字段
├── advanced_options # 嵌套的 advanced_options 默认值
├── oneof_choices # OneOf 默认选择
└── ui_vs_server # UI 与服务器的差异

源服务器可以使用不同的类型变体进行指定。类型决定了所需的附加字段。

类型描述必填字段状态
public_name使用公共 DNS 名称的源服务器dns_name✅ 已完成
public_ip使用公共 IP 地址的源服务器ip(IPv4)✅ 已完成
{
"origin_servers": [
{
"public_name": {
"dns_name": "backend.example.com"
}
}
]
}
{
"origin_servers": [
{
"public_ip": {
"ip": "8.8.8.8"
}
}
]
}

待办:依赖站点的源服务器类型

Section titled “待办:依赖站点的源服务器类型”

以下源服务器类型在实现之前需要完成”站点”资源逻辑的开发:

类型描述必填字段状态
private_ip带有私有/公共 IP 和站点信息的源服务器ip, site_locator, network_choice, snat_pool🔲 待完成站点逻辑
private_name带有 DNS 名称和站点信息的源服务器dns_name, site_locator, network_choice, snat_pool🔲 待完成站点逻辑
k8s_service带有站点信息的 Kubernetes 服务service_name, site_locator, network_choice🔲 待完成站点逻辑
consul_service带有站点信息的 HashiCorp Consul 服务service_name, site_locator, network_choice🔲 待完成站点逻辑

在对这些类型进行完整记录之前,需要完成以下工作:

  1. 站点资源发现 - 记录 site 资源模式和 site_locator 模式
  2. 网络选择枚举 - 记录 network_choice 的约束值(site_local_inside、site_local_outside 等)
  3. SNAT 池选项 - 记录 SNAT 池配置模式
  4. 跨资源引用 - 定义 origin_pool 如何引用站点资源
  • 配置占位符:config/discovered_defaults.yamlorigin_pool.origin_server_types.enums
  • 相关迭代:站点资源模式丰富化
版本日期变更内容
2.1.22026-01-18新增包含 public_name/public_ip 的源服务器类型章节;为依赖站点的类型添加 TODO 标记
2.1.12026-01-18重写为纯 API 参考;移除下游代码示例
2.1.02026-01-18更新为 validation.json 中的统一默认值结构
2.0.332026-01-17源池增强文档初始版本