feat(firewall): add named sets to FirewallConfiguration #3155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This Pull Request (PR) extends the functionality introduced in PR #2966 (firewalling rules implementation within
FirewallConfiguration).The primary goal of these changes is to enable the creation and utilization of named sets within the
FirewallConfigurationCustom Resource (CR) to support the definition of more complex nftables rules. Named sets significantly improve the readability and management of firewall rules, especially when dealing with large lists of IP addresses or other match criteria.Changes
Mandatory Modifications
setsField Addition: TheFirewallConfigurationCR now includes a new field,sets, allowing users to specify a list of sets to be created and used. This includes defining the key and value types for each set (at the moment onlyipv4_addris supported).FirewallConfigurationreconciler logic has been updated to handle the addition, modification, and removal of these named sets within the firewall configuration.@<set_name>in the match value.Strongly Recommended Modification (Separate Commit)
Example Usage
This example demonstrates how to define and use a named set (
test_set) containing multiple IPv4 addresses within afilterRule.