-
Notifications
You must be signed in to change notification settings - Fork 373
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
Record an event when Egress IP assignment changes #5765
Conversation
d23db4b
to
ee8a7e4
Compare
408448f
to
f2cb840
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.
Can you validate the event is received in e2e testEgressCRUD
?
f2cb840
to
a4e8104
Compare
f20c9b2
to
169f508
Compare
8320b84
to
d28a2d1
Compare
d28a2d1
to
fca9c90
Compare
fca9c90
to
b11d5c4
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.
The title could be more specific, like "Record an event when Egress IP assignment changes"
b11d5c4
to
fe760bc
Compare
6720c1a
to
1a7e460
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.
It should add patch and update permission of events, otherwise it can't correctly record events in some case:
I0102 05:49:41.364352 1 event.go:294] "Event occurred" object="egress-pirate-pods" fieldPath="" kind="Egress" apiVersion="crd.antrea.io/v1beta1" type="Normal" reason="IPAssigned" message="Assigned Egress egress-pirate-pods with IP 172.18.0.10 on Node kind-worker"
E0102 05:49:41.366451 1 event.go:267] Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"egress-pirate-pods.17a671a773e1d992", GenerateName:"", Namespace:"default", SelfLink:"", UID:"", ResourceVersion:"1122", Generation:0, CreationTimestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), DeletionTimestamp:<nil>, DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"Egress", Namespace:"", Name:"egress-pirate-pods", UID:"9a3312c6-c90f-446d-b112-d6af3b43d330", APIVersion:"crd.antrea.io/v1beta1", ResourceVersion:"1266", FieldPath:""}, Reason:"IPAssigned", Message:"Assigned Egress egress-pirate-pods with IP 172.18.0.10 on Node kind-worker", Source:v1.EventSource{Component:"AntreaAgentEgressController", Host:""}, FirstTimestamp:time.Date(2024, time.January, 2, 5, 47, 53, 0, time.Local), LastTimestamp:time.Date(2024, time.January, 2, 5, 49, 41, 364053810, time.Local), Count:2, Type:"Normal", EventTime:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), Series:(*v1.EventSeries)(nil), Action:"", Related:(*v1.ObjectReference)(nil), ReportingController:"", ReportingInstance:""}': 'events "egress-pirate-pods.17a671a773e1d992" is forbidden: User "system:serviceaccount:kube-system:antrea-agent" cannot patch resource "events" in API group "" in the namespace "default"' (will not retry!)
1a7e460
to
c2d24ad
Compare
Record an event when EgressIP is assigned to the Node interface or when it is unassigned from the Node interface. Signed-off-by: Pulkit Jain <jainpu@vmware.com>
c2d24ad
to
c07d213
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
/test-all |
/skip-conformance which failed due to a service IP overlapping with server IP |
/skip-conformance |
Fixes #4614.
Record event when EgressIP is assigned to the Node interface.