Skip to content

Comments

reconcile allowedaddresses in nic#83

Merged
ske-prow[bot] merged 7 commits intomainfrom
allowed-addresses
Jan 21, 2026
Merged

reconcile allowedaddresses in nic#83
ske-prow[bot] merged 7 commits intomainfrom
allowed-addresses

Conversation

@breuerfelix
Copy link
Member

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:

We need this MR in order to put the pod network CIDR into the allowedAddresses in the stackit MCM. Otherwise pod to pod communication does not work when using native kubernetes networking.

Special notes for your reviewer:

Breaking changes:

@ske-prow
Copy link

ske-prow bot commented Jan 14, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ske-prow ske-prow bot added kind/enhancement Enhancement, improvement, extension do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 14, 2026
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
@ske-prow ske-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 14, 2026
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
@ske-prow ske-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 16, 2026
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
@breuerfelix breuerfelix marked this pull request as ready for review January 19, 2026 11:17
@ske-prow ske-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 19, 2026
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
@hown3d
Copy link
Member

hown3d commented Jan 19, 2026

In openstack this is done in the Route controller.

Why do you want to do this here?

@breuerfelix
Copy link
Member Author

In openstack this is done in the Route controller.

Why do you want to do this here?

https://github.com/gardener/machine-controller-manager-provider-openstack/blob/master/pkg/driver/executor/executor.go#L144

This is done in the Openstack MCM. It takes the podNetworkCIDR and puts it into the AllowedAddressPairs. Thats why I also wanna do it in the STACKIT MCM.

Copy link
Member

@hown3d hown3d left a comment

Choose a reason for hiding this comment

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

overall good, some QOL changes.


// AllowedAddresses are the IP address ranges (CIDRs) allowed to originate traffic from the server's network interface.
// Optional field. If specified, these ranges are configured as AllowedAddresses on the network interface of the server to bypass anti-spoofing rules.
AllowedAddresses []string `json:"allowedAddresses,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Should be part of NetworkingSpec

Copy link
Member Author

Choose a reason for hiding this comment

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

I would not put that in NetworkingSpec since other MCM providers are also passing almost all config in the top level.
The NetworkingSpec has only 2 configuration options which are mutually exclusive. And even Networking is optional because if it is not set, the VM is put into the "default" network. So the Networking field has its own logic separate from the allowedAddresses.

}
}

// Validate AllowedAddresses
Copy link
Member

Choose a reason for hiding this comment

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

move into validateNetworking function

Copy link
Member Author

Choose a reason for hiding this comment

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

same as above


func (p *Provider) getServerByName(ctx context.Context, projectID, region, serverName string) (*Server, error) {
// Check if the server got already created
labelSelector := fmt.Sprintf("mcm.gardener.cloud/machine=%s", serverName)
Copy link
Member

Choose a reason for hiding this comment

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

Use constant StackitMachineLabel

Copy link
Member

Choose a reason for hiding this comment

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

nit:
It was confusing that the labels are here put in as raw string with '=' concatination while in the request they were put in as map[string]string.
This is somewhat inconsistent. Labels should be used the same way across API requests.

Copy link
Member Author

Choose a reason for hiding this comment

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

We have to refactor the labels anyways in another task so i would like to refactor them in another PR.

For the Labels... its the SDK ... but I changed our interface to consume a map and create the label string on the fly

Copy link
Member

Choose a reason for hiding this comment

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

nit: Might be worth to separate functions into other files (e.g. network.go for network related functions).
Having a single core.go that will grow is not really clear to overlook in the long run.

Copy link
Member Author

Choose a reason for hiding this comment

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

solve in another story

Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
@ske-prow ske-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2026
@ske-prow
Copy link

ske-prow bot commented Jan 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hown3d

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

The pull request process is described here

Details 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

@ske-prow
Copy link

ske-prow bot commented Jan 21, 2026

LGTM label has been added.

DetailsGit tree hash: eebd653688f9351ee136c13890f4bd9dcab6df21

@ske-prow ske-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2026
@ske-prow ske-prow bot merged commit 1d4a215 into main Jan 21, 2026
3 checks passed
@breuerfelix breuerfelix deleted the allowed-addresses branch February 18, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants