Skip to content

Provide a ignore-exclude-lb flag - #2280

Merged
fedepaol merged 4 commits into
metallb:mainfrom
fedepaol:excludelbnob
Feb 20, 2024
Merged

fedepaol merged 4 commits into
metallb:mainfrom
fedepaol:excludelbnob

Conversation

@fedepaol

Copy link
Copy Markdown
Member

MetalLB now honors the node.kubernetes.io/exclude-from-external-load-balancers
but this might harm some deployments where there is only one node and
kubeadm still labels the control plane with such label.

Here we provide a knob to disable the behaviour and make metallb work in
such scenarios.

@fedepaol

Copy link
Copy Markdown
Member Author

Fixes #2274

Comment thread charts/metallb/values.yaml Outdated
fullnameOverride: ""
loadBalancerClass: ""
# ignore the exclude-from-external-loadbalancer annotation
ignoreExcludeLB: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to put it on speaker?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reasoning was, this is a property of metallb as a whole. It has direct effects only on the speaker, but it felt more like a property similar to "loadBalancerClass". Does it make sense? If not I am open to move it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we already have a similar configuration, see

excludeInterfaces:

It's more of a speaker-related property, but I'm ok with both, it's up to you :)

nit: the comment should be updated: ignore the exclude-from-external-loadbalancer label

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I'll change it.
Also, thanks for the comment, I missed it!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread speaker/main.go Outdated
logLevel = flag.String("log-level", "info", fmt.Sprintf("log level. must be one of: [%s]", logging.Levels.String()))
enablePprof = flag.Bool("enable-pprof", false, "Enable pprof profiling")
loadBalancerClass = flag.String("lb-class", "", "load balancer class. When enabled, metallb will handle only services whose spec.loadBalancerClass matches the given lb class")
ignoreLBExclude = flag.Bool("ignore-exclude-lb", false, "ignore the exclude-from-external-load-balancers annotation")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: annotation -> label

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread website/content/release-notes/_index.md Outdated

New Features:

- Provide a "ignore-exclude-lb" flag to ignore the `exclude-from-external-load-balancers` annotation ([PR 2280](https://github.com/metallb/metallb/pull/2280), [Issue 2274](https://github.com/metallb/metallb/issues/2274))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: annotation -> label

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


## MetalLB is not advertising my service from my control-plane nodes or from my single node cluster

Make sure your nodes are not labeled with the [node.kubernetes.io/exclude-from-external-load-balancers](https://kubernetes.io/docs/reference/labels-annotations-taints/#node-kubernetes-io-exclude-from-external-load-balancers) annotation. MetalLB honors that annotation and won't announce any service from

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: annotation -> label

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@oribon oribon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (other than a dangling "annotation" instead of "label"

Removing a check that was making all the tests be skipped, and fix a
broken test.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
MetalLB now honors the node.kubernetes.io/exclude-from-external-load-balancers
but this might harm some deployments where there is only one node and
kubeadm still labels the control plane with such label.

Here we provide a knob to disable the behaviour and make metallb work in
such scenarios.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
We allow disabling the exclusion from the chart.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
This might harm multiple users, so we mention it and we document how to
work it around.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
@fedepaol
fedepaol merged commit f781c7e into metallb:main Feb 20, 2024
@onigoetz

Copy link
Copy Markdown

Hi, I just stumbled onto this issue and the fix that goes with it.
I can't use this for now; is a release of the new version of the helm chart planned soon ?

Thanks in advance

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants