Prerequisite: Already provision K3s cluster and cloud provider on test plan
- 59-Create K3s Kubernetes Cluster
- 61-Deploy Harvester cloud provider to k3s Cluster
Create Nginx workload for testing
- Create a test-nginx deployment with image nginx:latest.
- Add pod label test: test.
Create a Pool LoadBalancer
-
Modify vip-pool in Harvester settings.
-
Open Kubectl shell.
-
Create
test-pool-lb.yaml
file.apiVersion: v1 kind: Service metadata: annotations: cloudprovider.harvesterhci.io/ipam: pool name: test-pool-lb namespace: default spec: ports: - name: http nodePort: 32155 port: 8080 protocol: TCP targetPort: 80 selector: test: test sessionAffinity: None type: LoadBalancer
-
Run
k apply -f test-pool-lb.yaml
to apply it. -
The Pool LoadBalancer should get an IP from vip-pool and work.
Expected Results
- Can create
Pool
load balance service correctly - Can route workload to nginx deployment