跳到內容

來源池增強功能

origin_pool 相關 schema 的豐富化中繼資料。有關擴充定義,請參閱 OpenAPI 擴充

所有符合 origin_pool.*SpecType 的 schema 均會接受豐富化處理:

  • 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停用 LB 來源 IP 持久性
路徑預設值描述
origin_servers[].labels{}空的標籤物件
origin_servers[].public_name.refresh_interval0使用系統預設 DNS 重新整理

F5 XC 網頁 UI 的預選值與省略欄位時 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
LB 來源 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 網頁主控台為來源池提供 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
15LB 來源 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包含所有 schema 的合併規格
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 資源 schema 及 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
  • 相關衝刺:站點資源 schema 豐富化
版本日期變更內容
2.1.22026-01-18新增來源伺服器類型章節,包含 public_name/public_ip;為依賴站點的類型新增待辦標記
2.1.12026-01-18改寫為純 API 參考;移除下游程式碼範例
2.1.02026-01-18更新為 validation.json 中的統一預設值結構
2.0.332026-01-17初始來源池增強功能文件