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
Refine LoadBalancer service access control and consolidating security-rules #5164
Refine LoadBalancer service access control and consolidating security-rules #5164
Conversation
Hi @lodrem. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
dc95d8b
to
f4ce112
Compare
/kind feature |
/ok-to-test |
The IPV6 address in the last example does not appear in the source column of the screenshot. Is it expected? |
f4ce112
to
00b55ba
Compare
046915e
to
7b157f3
Compare
) | ||
|
||
t.Run("internal Load Balancer", func(t *testing.T) { | ||
t.Run("noop when no allow list specified", func(t *testing.T) { |
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.
any tests when ILB services are annotated with allowded CIRDs and service tags?
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.
Good catch. Added a few more tests for ILB. They should cover its code path.
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.
Thank you for the excellent refactoring. The code is much clearer now. The changes LGTM in general, just added a few comments.
34422c6
to
a7d613b
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feiskyer, lodrem The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a7d613b
to
87a5835
Compare
/lgtm |
Looks amazing - thank you for all the hard work and reviews, @lodrem , @nilo19 , @feiskyer, @lzhecheng, and anyone else I missed! |
What type of PR is this?
/cleanup
What this PR does / why we need it:
Purpose: create as few security rules as possible. (detail in #4713)
This PR has a ton of changes because we’ve completely changed the pattern for security rules.
Some screenshots:
Without allow list
IPv4
IPv4 and IPv6
With additional public IPs
Disable floating IP
NOTE: use backend pool nodes IPs as the destination addresses
With allow list
Which issue(s) this PR fixes:
Fixes #4713
Fixes #4919
Special notes for your reviewer:
I’ve rewritten the logic that handles the configuration, but it should still behave the same way:
service.beta.kubernetes.io/azure-allowed-ip-ranges
service.beta.kubernetes.io/azure-allowed-service-tags
service.beta.kubernetes.io/azure-disable-load-balancer-floating-ip
service.beta.kubernetes.io/azure-additional-public-ips
spec.LoadBalancerSourceRanges
The annotations would be deprecated after this change:
service.beta.kubernetes.io/azure-shared-securityrule
now all the rules would be as shared.code review guidance
This PR is pretty big, so I’ll break it down here to make it less of a headache. Sorry in advance!
SecurityGroup
put operation would still be in ./pkg/provider/azure_loadbalancer.go#reconcileSecurityGroupThe E2E tests aren’t finished yet (they still need some refactoring), but you can already start reviewing.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: