Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use static assignment with IPAddressPool #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yprokule
Copy link
Contributor

@yprokule yprokule commented Sep 5, 2024

Leave IP address assignment to the operators

@openshift-ci openshift-ci bot requested review from yanirq and yuvalk September 5, 2024 07:41
Copy link

openshift-ci bot commented Sep 5, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yprokule
Once this PR has been reviewed and has the lgtm label, please assign imiller0 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yprokule
Copy link
Contributor Author

yprokule commented Sep 5, 2024

/cc @imiller0 @MarSik

@openshift-ci openshift-ci bot requested review from imiller0 and MarSik September 5, 2024 07:55
@lack
Copy link
Member

lack commented Sep 19, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 19, 2024
@@ -13,5 +13,5 @@ spec:
{{ .spec.addresses | toYaml | indent 2}}
{{ end }}
#- 3.3.3.0/24
autoAssign: true
autoAssign: false
Copy link
Member

Choose a reason for hiding this comment

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

is this really what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the justification is that if IPAddressPool contains multiple IP addresses then static assignments will ensure that CNF-A always has IP address X.X.X.X(unless IPAddressPool is solely dedicated to the CNF-A)

Copy link
Member

Choose a reason for hiding this comment

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

if that's a requirement, the right way to address it is to use the service / namespace selectors in the ip address pools (assuming each CNF will have its own namespace, but that can be done per service too).

This guarantees each cnf will have the ip the admin means to assign to them, otherwise they can steal the ip from any pool.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good points @fedepaol. And while without service/namespace selectors IP address from any IPAddressPool could be selected, imho autoAssign set to false is a good safety net from assigning not expected IP addresses.

Copy link
Member

Choose a reason for hiding this comment

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

yes but here we are advocating for static IPs requested by the CNF always, which feels like the exception to me, not the norm. And bear in mind, if you have a pool of ips with autoAssign = false and no selector, any CNF can get any IP they want from that pool, which is not really a safety net.

If you ask me, the proper way to have a good ux and ensure the right tenant gets the right ip(s), this is with selectors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fedepaol , I added serviceAllocation stanza to the CR, wdyt?

@yprokule yprokule requested a review from fedepaol October 8, 2024 10:20
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 10, 2024
@yprokule yprokule force-pushed the metallb-static-assignment branch from 16eedb9 to 812c0ad Compare December 10, 2024 09:20
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 10, 2024
Copy link

openshift-ci bot commented Dec 10, 2024

New changes are detected. LGTM label has been removed.

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 10, 2024
Comment on lines +17 to +21
{{ if .spec.serviceAllocation.namespaces }}
serviceAllocation:
namespaces:
{{ .spec.serviceAllocation.namespaces | toYaml | indent 4}}
{{ end }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lack could U please check if the syntax is correct here, thanks!

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