0

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?

1 Answer 1

2

They are automatically created when you are using an External Load Balancer.

From Docs:

LoadBalancer: Exposes the Service externally using a cloud provider’s load balancer. NodePort and ClusterIP Services, to which the external load balancer routes, are automatically created.

https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types

2
  • Is there any way to get around this?
    – bear
    Dec 8, 2019 at 22:43
  • I'm not seeing this in the metallb docs that it happens in the examples
    – bear
    Dec 8, 2019 at 22:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .