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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ 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?

{{ if .spec.serviceAllocation.namespaces }}
serviceAllocation:
namespaces:
{{ .spec.serviceAllocation.namespaces | toYaml | indent 4}}
{{ end }}
Comment on lines +17 to +21
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!

##############
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ spec:
# Expected variation in this configuration
addresses: [ $pools ]
# - 3.3.3.0/24
autoAssign: true
autoAssign: false
##############
serviceAllocation:
namespaces: [ $namespaces ]
# - app-ns-one