- 首页
- F5 Distributed Cloud Tools for Visual Studio Code
- How To
- Deploy an HTTP Load Balancer
Deploy an HTTP Load Balancer
此内容尚不支持你的语言。
This guide walks you through creating and deploying an HTTP Load Balancer with an associated Origin Pool and Health Check on F5 Distributed Cloud using declarative manifests in Visual Studio Code.
Prerequisites
Section titled “Prerequisites”Before starting this procedure, ensure you have:
- Installed the F5 Distributed Cloud Tools extension in Visual Studio Code.
- Configured an active profile connected to your target tenant (see Profile Setup).
- Set your active namespace to
production(or your target workspace namespace). - An accessible backend server IP address (this guide uses the RFC 5737 test address
198.51.100.10).
Step 1: Create the Health Check
Section titled “Step 1: Create the Health Check”-
In your workspace, create a new file named
web-healthcheck.yaml. -
Add the following configuration:
metadata:name: web-healthchecknamespace: productionspec:http_health_check:path: /healthuse_origin_server_name: trueinterval: 15timeout: 5healthy_threshold: 2unhealthy_threshold: 3 -
Open the file in the editor and press
Ctrl+Shift+A(macOS:Cmd+Shift+A) to apply the health check to your tenant.
Step 2: Create the Origin Pool
Section titled “Step 2: Create the Origin Pool”-
In your workspace, create a file named
web-origin-pool.yaml. -
Add the origin pool definition referencing the health check created in Step 1:
metadata:name: web-origin-poolnamespace: productionspec:origin_servers:- public_ip:ip: 198.51.100.10port: 8080healthcheck:- name: web-healthchecknamespace: productionloadbalancer_algorithm: LB_OVERRIDE -
Press
Ctrl+Shift+A(macOS:Cmd+Shift+A) to apply the origin pool.
Step 3: Create the HTTP Load Balancer
Section titled “Step 3: Create the HTTP Load Balancer”-
In your workspace, create a file named
web-loadbalancer.yaml. -
Add the load balancer configuration referencing your origin pool and enabling automatic TLS certificates:
metadata:name: web-loadbalancernamespace: productionspec:domains:- app.example.comhttps_auto_cert:http_redirect: trueadd_hsts: truedefault_route_pools:- pool:name: web-origin-poolnamespace: productionweight: 1no_challenge: {}disable_rate_limit: {}no_service_policies: {}round_robin: {} -
Press
Ctrl+Shift+A(macOS:Cmd+Shift+A) to apply the load balancer.
Verify the Deployment
Section titled “Verify the Deployment”- Open the F5 Distributed Cloud Tools view container from the Activity Bar.
- In the Explorer view, expand HTTP Load Balancers.
- Locate
web-loadbalancer, right-click, and select Generate Diagram (xcsh.diagram). - Confirm that the diagram illustrates traffic flowing from
app.example.comthrough the load balancer intoweb-origin-poolwith the active health check. - Right-click
web-loadbalancerand select Describe to verify the provisioning state.
Clean Up
Section titled “Clean Up”To remove the resources created in this guide:
- In the Explorer view, right-click
web-loadbalancerand select Delete Resource. - Right-click
web-origin-pooland select Delete Resource. - Right-click
web-healthcheckand select Delete Resource.