Skip to content

Commit

Permalink
Update kubernetes watch configuration to prioritise performance (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
XAMPPRocky authored Nov 1, 2023
1 parent 334c75f commit 0a2b4e6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/config/providers/k8s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,16 @@ fn gameserver_events(
let gameservers_namespace = namespace.as_ref();
let gameservers: kube::Api<GameServer> = kube::Api::namespaced(client, gameservers_namespace);
let gs_writer = kube::runtime::reflector::store::Writer::<GameServer>::default();
let gameserver_stream = kube::runtime::watcher(gameservers, <_>::default());
let mut config = kube::runtime::watcher::Config::default()
// Default timeout is 5 minutes, far too slow for us to react.
.timeout(15)
// Use `Any` as we care about speed more than consistency.
.any_semantic();

// Retreive unbounded results.
config.page_size = None;

let gameserver_stream = kube::runtime::watcher(gameservers, config);
kube::runtime::reflector(gs_writer, gameserver_stream)
}

Expand Down

0 comments on commit 0a2b4e6

Please sign in to comment.