Skip to content

[feat] Multiple type: LoadBalancer Services on one NodeBalancer, each with its own auto-provisioned IP #665

Open

Description

@dlebee

What we want

Several Services of type: LoadBalancer that all listen on the same port, served by a single NodeBalancer, with a separate public IPv4 provisioned automatically for each Service:

apiVersion: v1
kind: Service
metadata:
  name: node-a
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-shared: "true"
spec:
  type: LoadBalancer
  ports: [{ port: 30333 }]
---
apiVersion: v1
kind: Service
metadata:
  name: node-b
  annotations:
    service.beta.kubernetes.io/linode-loadbalancer-shared: "true"
spec:
  type: LoadBalancer
  ports: [{ port: 30333 }]

Expected result: one NodeBalancer, two frontend IPs.

  • node-a gets status.loadBalancer.ingress[0].ip = 198.51.100.10, and 198.51.100.10:30333 routes to node-a's NodePort.
  • node-b gets status.loadBalancer.ingress[0].ip = 198.51.100.11, and 198.51.100.11:30333 routes to node-b's NodePort.

Neither Service specifies an IP or a NodeBalancer ID; the controller allocates the IP and attaches it to the shared NodeBalancer. (The shared annotation name is only a suggestion.)

Why it doesn't work today

  • A NodeBalancer has exactly one public IPv4, and configs are identified by port alone, so two Services cannot both use 30333 on the same NodeBalancer.
  • The controller creates one NodeBalancer per Service. Pointing two Services at the same nodebalancer-id makes them delete each other's configs (deleteUnusedConfigs), and deleting either Service deletes the NodeBalancer (EnsureLoadBalancerDeleted).

What it would need

  1. NodeBalancer platform: multiple frontend IPv4 addresses per NodeBalancer, with configs keyed by (IP, port) instead of port.
  2. Controller: in shared mode, allocate a frontend IP per Service on the shared NodeBalancer, manage only that Service's (IP, port) configs, release the IP when the Service is deleted, and delete the NodeBalancer only when no Service uses it.

Why

Workloads such as p2p nodes need one stable public IP per instance on a fixed, identical port. Today that costs one NodeBalancer per Service, even though a single load balancer with multiple frontend IPs would serve all of them.

Out of scope

Sharing a NodeBalancer across clusters.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions