From cc5e90d2589ca28affdce5fbf7c30934e1a4836e Mon Sep 17 00:00:00 2001 From: backguynn <88170638+backguynn@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:17:36 +0900 Subject: [PATCH] Update kube-loxilb.md --- docs/kube-loxilb.md | 149 ++++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 75 deletions(-) diff --git a/docs/kube-loxilb.md b/docs/kube-loxilb.md index f79228b1..e56ec974 100644 --- a/docs/kube-loxilb.md +++ b/docs/kube-loxilb.md @@ -33,14 +33,14 @@ kube-loxilb is a standalone implementation of kubernetes load-balancer spec whic 2. Download the loxilb config yaml : -``` -wget https://github.com/loxilb-io/kube-loxilb/raw/main/manifest/kube-loxilb.yaml -``` + ``` + wget https://github.com/loxilb-io/kube-loxilb/raw/main/manifest/kube-loxilb.yaml + ``` 3. Modify arguments as per user's needs : -``` -args: + ``` + args: - --loxiURL=http://12.12.12.1:11111 - --externalCIDR=123.123.123.1/24 #- --externalSecondaryCIDRs=124.124.124.1/24,125.125.125.1/24 @@ -51,90 +51,89 @@ args: #- --setRoles=0.0.0.0 #- --setLBMode=1 #- --setUniqueIP=false -``` - -The arguments have the following meaning : - -| name | description | -| ----------- | ----------- | -| loxiURL | API server address of loxilb. This is the docker IP address loxilb docker of Step 1. If unspecified, kube-loxilb assumes loxilb is running in-cluster mode and autoconfigures this. | -| externalCIDR | CIDR or IPAddress range to allocate addresses from. By default address allocated are shared for different services(shared Mode) | -| externalCIDR6 | Ipv6 CIDR or IPAddress range to allocate addresses from. By default address allocated are shared for different services(shared Mode) | -| monitor | Enable liveness probe for the LB end-points (default : unset) | -| setBGP | Use specified BGP AS-ID to advertise this service. If not specified BGP will be disabled. Please check [here](https://github.com/loxilb-io/loxilbdocs/blob/main/docs/integrate_bgp_eng.md) how it works. | -| extBGPPeers | Specifies external BGP peers with appropriate remote AS | -| setRoles | If present, kube-loxilb arbitrates loxilb role(s) in cluster-mode. Further, it sets a special VIP (selected as sourceIP) to communicate with end-points in full-nat mode. | -| setLBMode | 0, 1, 2
0 - default (only DNAT, preserves source-IP)
1 - onearm (source IP is changed to load balancer’s interface IP)
2 - fullNAT (sourceIP is changed to virtual IP) | -| setUniqueIP | Allocate unique service-IP per LB service (default : false) | -| externalSecondaryCIDRs | Secondary CIDR or IPAddress ranges to allocate addresses from in case of multi-homing support | + ``` + + The arguments have the following meaning : + + | name | description | + | ----------- | ----------- | + | loxiURL | API server address of loxilb. This is the docker IP address loxilb docker of Step 1. If unspecified, kube-loxilb assumes loxilb is running in-cluster mode and autoconfigures this. | + | externalCIDR | CIDR or IPAddress range to allocate addresses from. By default address allocated are shared for different services(shared Mode) | + | externalCIDR6 | Ipv6 CIDR or IPAddress range to allocate addresses from. By default address allocated are shared for different services(shared Mode) | + | monitor | Enable liveness probe for the LB end-points (default : unset) | + | setBGP | Use specified BGP AS-ID to advertise this service. If not specified BGP will be disabled. Please check [here](https://github.com/loxilb-io/loxilbdocs/blob/main/docs/integrate_bgp_eng.md) how it works. | + | extBGPPeers | Specifies external BGP peers with appropriate remote AS | + | setRoles | If present, kube-loxilb arbitrates loxilb role(s) in cluster-mode. Further, it sets a special VIP (selected as sourceIP) to communicate with end-points in full-nat mode. | + | setLBMode | 0, 1, 2
0 - default (only DNAT, preserves source-IP)
1 - onearm (source IP is changed to load balancer’s interface IP)
2 - fullNAT (sourceIP is changed to virtual IP) | + | setUniqueIP | Allocate unique service-IP per LB service (default : false) | + | externalSecondaryCIDRs | Secondary CIDR or IPAddress ranges to allocate addresses from in case of multi-homing support | -Many of the above flags and arguments can be overriden on a per-service basis based on loxilb specific annotation as mentioned in section 6 below. + Many of the above flags and arguments can be overriden on a per-service basis based on loxilb specific annotation as mentioned in section 6 below. 4. Apply the following : -``` -kubectl apply -f kube-loxilb.yaml -``` + ``` + kubectl apply -f kube-loxilb.yaml + ``` 5. The above should make sure kube-loxilb is successfully running. Check kube-loxilb is running : -``` -kubectl get pods -A | grep kube-loxilb -``` - + ``` + kubectl get pods -A | grep kube-loxilb + ``` 6. Finally to create service LB, we can use and apply the following template yaml -(Note - Check *loadBalancerClass* and other *loxilb* specific annotation) : - -```yaml -apiVersion: v1 -kind: Service -metadata: - name: iperf-service - annotations: - # If there is a need to do liveness check from loxilb - loxilb.io/liveness: "yes" - # Specify LB mode - one of default, onearm or fullnat - loxilb.io/lbmode: "default" - # Specify loxilb IPAM mode - one of ipv4, ipv6 or ipv6to4 - loxilb.io/ipam: "ipv4" - # Specify number of secondary networks for multi-homing - # Only valid for SCTP currently - # loxilb.io/num-secondary-networks: "2 -spec: - loadBalancerClass: loxilb.io/loxilb - selector: - what: perf-test - ports: - - port: 55001 - targetPort: 5001 - type: LoadBalancer ---- -apiVersion: v1 -kind: Pod -metadata: - name: iperf1 - labels: - what: perf-test -spec: - containers: - - name: iperf - image: eyes852/ubuntu-iperf-test:0.5 - command: - - iperf - - "-s" + (Note - Check *loadBalancerClass* and other *loxilb* specific annotation) : + + ```yaml + apiVersion: v1 + kind: Service + metadata: + name: iperf-service + annotations: + # If there is a need to do liveness check from loxilb + loxilb.io/liveness: "yes" + # Specify LB mode - one of default, onearm or fullnat + loxilb.io/lbmode: "default" + # Specify loxilb IPAM mode - one of ipv4, ipv6 or ipv6to4 + loxilb.io/ipam: "ipv4" + # Specify number of secondary networks for multi-homing + # Only valid for SCTP currently + # loxilb.io/num-secondary-networks: "2 + spec: + loadBalancerClass: loxilb.io/loxilb + selector: + what: perf-test ports: - - containerPort: 5001 -``` - -Users can change the above as per their needs. + - port: 55001 + targetPort: 5001 + type: LoadBalancer + --- + apiVersion: v1 + kind: Pod + metadata: + name: iperf1 + labels: + what: perf-test + spec: + containers: + - name: iperf + image: eyes852/ubuntu-iperf-test:0.5 + command: + - iperf + - "-s" + ports: + - containerPort: 5001 + ``` + + Users can change the above as per their needs. 7. Verify LB service is created -``` -kubectl get svc -``` + ``` + kubectl get svc + ``` For more example yaml templates, kindly refer to kube-loxilb's manifest [directory](https://github.com/loxilb-io/kube-loxilb/tree/main/manifest)