-
Notifications
You must be signed in to change notification settings - Fork 7
Add ability to configure NAT type and parameters from K8s #1197
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
Conversation
d27619f to
3e1da5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for configuring NAT type and parameters directly from Kubernetes manifests, addressing a gap that existed after the migration from gRPC to K8s-based configuration.
Changes:
- Adds K8s NAT configuration parsing with validation for stateful/stateless modes
- Updates stateful NAT idle timeout default from Duration::default() to 2 minutes
- Adds comprehensive unit tests for NAT configuration validation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| config/src/external/overlay/vpcpeering.rs | Updates idle timeout default value and simplifies NAT configuration assignment |
| config/src/converters/k8s/config/expose.rs | Adds K8s NAT configuration parsing logic and comprehensive test coverage |
3e1da5c to
127334f
Compare
Fredi-raspall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this. The changes look good to me, except for the couple of things mentioned.
Previously idle_timeout would be set to 0 if not explicitly set when calling VpcExpose::make_stateful_nat. This commit restructures the make_stateful_nat code to use the default implementation of the stateful NAT options which has the correct default duration. Signed-off-by: Manish Vachharajani <[email protected]>
127334f to
f78522d
Compare
The k8s conversion code was not properly setting the NAT config even when configured in k8s making it impossible to set stateful NAT. This adds the conversion and some unit tests. Signed-off-by: Manish Vachharajani <[email protected]>
f78522d to
6e58612
Compare
qmonnet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now, thank you!
Fredi-raspall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!

In the move from gRPC to K8s direct configuration, the NAT configuration was not properly converted (see #1194). This fixes that problem and adds unit tests for that configuration case.
Fixes #1194