Struct kube_runtime::watcher::Config
source · pub struct Config {
pub label_selector: Option<String>,
pub field_selector: Option<String>,
pub timeout: Option<u32>,
pub list_semantic: ListSemantic,
pub page_size: Option<u32>,
pub bookmarks: bool,
}
Expand description
Accumulates all options that can be used on the watcher invocation.
Fields§
§label_selector: Option<String>
A selector to restrict the list of returned objects by their labels.
Defaults to everything if None
.
field_selector: Option<String>
A selector to restrict the list of returned objects by their fields.
Defaults to everything if None
.
timeout: Option<u32>
Timeout for the list/watch call.
This limits the duration of the call, regardless of any activity or inactivity. If unset for a watch call, we will use 290s. We limit this to 295s due to inherent watch limitations.
list_semantic: ListSemantic
Semantics for list calls.
Configures re-list for performance vs. consistency.
page_size: Option<u32>
Maximum number of objects retrieved per list operation resyncs.
This can reduce the memory consumption during resyncs, at the cost of requiring more API roundtrips to complete.
Defaults to 500. Note that None
represents unbounded.
bookmarks: bool
Enables watch events with type “BOOKMARK”.
Requests watch bookmarks from the apiserver when enabled for improved watch precision and reduced list calls. This is default enabled and should generally not be turned off.
Implementations§
source§impl Config
impl Config
Builder interface to Config
Usage:
use kube::runtime::watcher::Config;
let wc = Config::default()
.timeout(60)
.labels("kubernetes.io/lifecycle=spot");
sourcepub fn timeout(self, timeout_secs: u32) -> Self
pub fn timeout(self, timeout_secs: u32) -> Self
Configure the timeout for list/watch calls
This limits the duration of the call, regardless of any activity or inactivity. Defaults to 290s
sourcepub fn fields(self, field_selector: &str) -> Self
pub fn fields(self, field_selector: &str) -> Self
Configure the selector to restrict the list of returned objects by their fields.
Defaults to everything.
Supports =
, ==
, !=
, and can be comma separated: key1=value1,key2=value2
.
The server only supports a limited number of field queries per type.
sourcepub fn labels(self, label_selector: &str) -> Self
pub fn labels(self, label_selector: &str) -> Self
Configure the selector to restrict the list of returned objects by their labels.
Defaults to everything.
Supports =
, ==
, !=
, and can be comma separated: key1=value1,key2=value2
.
sourcepub fn list_semantic(self, semantic: ListSemantic) -> Self
pub fn list_semantic(self, semantic: ListSemantic) -> Self
Sets list semantic to configure re-list performance and consistency
sourcepub fn any_semantic(self) -> Self
pub fn any_semantic(self) -> Self
Sets list semantic to Any
to improve list performance
sourcepub fn disable_bookmarks(self) -> Self
pub fn disable_bookmarks(self) -> Self
Disables watch bookmarks to simplify watch handling
This is not recommended to use with production watchers as it can cause desyncs. See #219 for details.