Service-Group zoning in loxilb

kube-loxilb is used to deploy loxilb with Kubernetes. By default a kube-loxilb instance does not differentiate the services in any way and uses a set-of loxilb instances to setup rules related to these services. But there are potential scenarios where grouping of services is necessary. It might be beneficial for increasing capacity, uptime and security of the cluster services.

Overall topology

For implementing service-groups with zones, the overall topology including all components should be similar to the following :

loxilb topology

The overall concept is to run multiple sets of kube-loxilb each for a separate zone. Each set of kube-loxilb communicates with a particular set of designated loxilb instances dedicated for that zone. Finally when the services are created, we need to mention which zone we want to place them in using special loxilb annotation.

How to deploy kube-loxilb for zones ?

  • The manifest files for deploying kube-loxilb for zones need to mention the zone they cater to. For example:


            - --loxiURL=
            - --externalCIDR=
            - --zone=south


            - --loxiURL=
            - --externalCIDR=
            - --zone=north
  • Complete kube-loxilb manifests for zones can be found here which can be further modified as per user need

  • After deployment, you can find multiple sets of kube-loxilb running as follows :

# sudo kubectl get pods -A
NAMESPACE     NAME                                      READY   STATUS    RESTARTS   AGE
kube-system   coredns-6799fbcd5-6w52r                   1/1     Running   0          11h
kube-system   local-path-provisioner-6c86858495-gkqgc   1/1     Running   0          11h
kube-system   metrics-server-67c658944b-vgjqd           1/1     Running   0          11h
default       udp-test                                  1/1     Running   0          11h
kube-system   kube-loxilb-south-596fb8957b-7xg2k        1/1     Running   0          11h
kube-system   kube-loxilb-north-5887f5d848-f86jv        1/1     Running   0          10h

How to deploy services for zones ?

  • The manifest files for services need to have annotation related to zone they will be served by. For example, we need to specify "" annotation :
apiVersion: v1
kind: Service
  name: nginx-lb1
  annotations: "fullnat" "10" "2" "north"
  externalTrafficPolicy: Local
    what: nginx-test
    - port: 55002
      targetPort: 80 
  type: LoadBalancer
apiVersion: v1
kind: Pod
  name: nginx-test
    what: nginx-test
    - name: nginx-test
      image: nginx:stable
        - containerPort: 80
  • Example services manifests for zones can be found here which can be further modified as per user need