-
Notifications
You must be signed in to change notification settings - Fork 2
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
use reflector for egress labeling #476
Conversation
eip_operator/src/main.rs
Outdated
let repeating_timer = IntervalStream::new(interval).map(|_| ()).boxed(); | ||
// run once at startup, every 5 minutes, and every time an EIP changes | ||
let mut stream = select_all([ | ||
once(async {}).boxed(), |
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.
I don't believe this is needed, eip_notifications
should have a queue based on the initial LIST
operation
eip_operator/src/main.rs
Outdated
// This allows the egress node to be re-labeled even if a new EIP event is missed | ||
let interval = time::interval(Duration::from_secs(300)); | ||
// timer needs to emit a `()` value for the select_all below | ||
let repeating_timer = IntervalStream::new(interval).map(|_| ()).boxed(); |
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.
at the point we're writing our own time-based reconciler + reflector, it now feels like we've reinvented the kube-rs Controller
, where we can return a requeue event for each Eip resource after it's reconciled to reschedule it for the future. I don't think we need our k8s-operator wrapper here that adds in finalizers, but I wonder if a plain Controller would work here?
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.
I wonder if we should make the finalizer an Option
. This isn't the first time that I've wanted controller-style reconciliations, but without the finalizer added.
Closing as this work is no longer necessary. |
Motivation
If the EIP operator pod is unavailable when an egress node rolls, there is a chance the new node will fail to get the
egress-gateway.materialize.cloud/ready-status: true
label.Use a reflector instead of a watch for egress labeling. These changes ensure the labeler runs on eip operator startup, on eip changes, and every 5 minutes. Running on a timer ensures if an EIP event is missed, the new node will get the required egress label.
Notes for reviewer
Works in my development environment. I let it run over the weekend with nodes rolling every 6 hours.