-
Notifications
You must be signed in to change notification settings - Fork 391
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
Add more configuration flexibility to Egress for user #7041
base: main
Are you sure you want to change the base?
Add more configuration flexibility to Egress for user #7041
Conversation
Can one of the admins verify this patch? |
83f9094
to
e25f867
Compare
Points to note:
My current implementation gives user the flexibility to decide whether to allow the traffic(best effort), or not(strict enforcement of egress policy). But In ideal case won't this be too confusing for the end user that static egress is configurable and dynamic is not, so should we keep the behaviour of both the egress consistent and make sure that when there is no node available for static egress then instead of dropping the traffic/packet we should allow the traffic to pass through the normal Node SNAT, same as in the case of dynamic egress. what's your opinion on this @tnqn @antoninbas |
|
e25f867
to
a4d3382
Compare
@antoninbas @tnqn I have updated the code making both dynamic and static egress configurable, based on the set failurePolicy which is an enum field in Egress Spec and supports two values 1) "Drop" 2) "NodeSNAT", if the field is set to 1 then if the egress node is not available the packet will be dropped in both the kind of egresses, while if the field is set to 2 then if the egress node is not available the packet will be forwarded via local NodeSNAT. |
@@ -1004,9 +1004,17 @@ type EgressSpec struct { | |||
// Cannot be set with ExternalIPPool. | |||
ExternalIPPools []string `json:"externalIPPools,omitempty"` | |||
// Bandwidth specifies the rate limit of north-south egress traffic of this Egress. | |||
Bandwidth *Bandwidth `json:"bandwidth,omitempty"` | |||
Bandwidth *Bandwidth `json:"bandwidth,omitempty"` | |||
FailurePolicy FailurePolicyType `json:"failurePolicy"` |
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.
Shouldn't it be a pointer given existing egress won't have it set?
And what's the default value? Please add proper comment for this new field for better understanding.
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.
Default would be NodeSNAT
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.
added comments
eState.pods.Insert(pod) | ||
stalePods.Delete(pod) | ||
failurePolicy := egress.Spec.FailurePolicy | ||
if failurePolicy == crdv1b1.FailurePolicyDrop || egressNodeAvailability(egress) { |
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.
This doesn't seem dropping the traffic but still sending it to the egress IP. This is more like Ignore
instead of Drop
.
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.
yes we are kind of Ignoring the packet
Added a FailurePolicy field to the Egress spec. If this field is set to "NodeSNAT" then if the egress node is not available due to any reason then the packet transfer or we can say the traffic will go via normal Node SNAT, while in the second case where this field is set to "Drop", and if egress node is not available packet won't go out and traffic will be stuck because of unavailability of egress node. Signed-off-by: Pulkit Jain <[email protected]>
a4d3382
to
366789e
Compare
Added an immutable FailurePolicy field to the Egress spec. If this field is set to "NodeSNAT" then if the egress node
is not available due to any reason then the packet transfer or we can say the traffic will go via normal Node SNAT, while in the second case where this field is set to "Drop", and if egress node is not available packet won't go out and traffic will be stuck because of unavailability of egress node.
Fixes #6988.