I've an on-prem, publicly exposed k8s node, and have configured metallb as the LB provider with a Traefik 2.0 Layer 4 LB.
I'm trying to figure out why the Traefik LB service has been assigned NodePorts:
kubectl describe svc traefik
Name: traefik
Namespace: default
Labels: <none>
Annotations: metallb.universe.tf/address-pool: default
Selector: app=traefik
Type: LoadBalancer
IP: 10.102.106.163
LoadBalancer Ingress: x.x.x.x
Port: web 80/TCP
TargetPort: 80/TCP
NodePort: web 30481/TCP
Endpoints: 192.168.152.4:80
Port: admin 8080/TCP
TargetPort: 8080/TCP
NodePort: admin 30839/TCP
Endpoints: 192.168.152.4:8080
Port: websecure 443/TCP
TargetPort: 443/TCP
NodePort: websecure 30647/TCP
Endpoints: 192.168.152.4:443
Session Affinity: None
External Traffic Policy: Cluster
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal IPAllocated 53m metallb-controller Assigned IP "x.x.x.x"
Normal nodeAssigned 2m21s (x13 over 53m) metallb-speaker announcing from node "x-lp-xxx-xx-xxxxx"
In what cases do LB services get assigned NodePorts?
They are automatically created when you are using an External Load Balancer.
From Docs:
https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types