kubermatic / kubelb

Kubernetes based load balancing
Apache License 2.0
107 stars 6 forks source link

KubeLB CLI for non-kubernetes usage #11

Open ahmedwaleedmalik opened 6 months ago

ahmedwaleedmalik commented 6 months ago

User Story As a KubeLB user/admin, I'd like to utilize KubeLB to provide LoadBalancers L4/L7 outside of Kubernetes as well.

Solution details Introduce KubeLB CLI, which can take YAML as input and create the required configurations on the management cluster. For now, this will only support L4 load balancing.

For example, create an LB like the following on the consumer cluster:

  1. loadbalancer.yaml
    apiVersion: kubelb.k8c.io/v1alpha1
    kind: LoadBalancer
    metadata:
    name: loadbalancer
    spec:
    endpoints:
    - addresses:
        - ip: 168.119.189.211
        - ip: 168.119.185.115
      ports:
        - name: a-port
          port: 32019
          protocol: TCP
    ports:
    - name: a-port
      port: 8080
      protocol: TCP
  2. Run kubelb create --loadbalancer loadbalancer.yaml --management-cluster ${path-to-kubeconfig-for-management-cluster}

This should result in the creation of an LB, and CLI should wait for the status to be populated to output the LB IP to the user.

Acceptance criteria Needs more planning to finalize the feature set for the CLI

toschneck commented 6 months ago

Maybe a krew plugin could also do the job

ahmedwaleedmalik commented 6 months ago

Maybe a krew plugin could also do the job

@toschneck The idea is to run this outside of Kubernetes and directly on the VMs themselves. In that case, relying on Kubectl and Krew doesn't sound ideal.