NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #1025 most downloaded on crates.io
Kubernetes client and async controller runtime
Latest stable
5.0.0
Last release 21 days ago
01 Nov 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
4 versions withdrawn
withdrawn after publishing
8 years old
134 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
Deprecate ListParams::timeout by @doxxx93 in https://github.com/kube-rs/kube/pull/2093
<!-- Release notes generated using configuration in .github/release.yml at 5.0.0 -->
As per the release schedule to match up with the latest Kubernetes Garhwal release. Lots of fixes and improvements. Thanks to everyone who contributed!
v1_37 support via k8s-openapi 0.29Please upgrade k8s-openapi along with kube to avoid conflicts.
Upgrades to several other important libraries that we couldn't do until the major. These include
tower-http@0.7, serde-saphyr@2, syn@3, base64@0.23 , pem@4,
A new Api::dynamic ctor has been added as well as Api::constrain* methods to change an Api's namespace. Simplifies Api handling when dealing with discovery;
// before
let api: Api<DynamicObject> = if caps.scope == Scope::Cluster {
Api::all_with(client.clone(), &ar)
} else {
Api::default_namespaced_with(client.clone(), &ar)
};
// after
let api: Api<DynamicObject> = Api::dynamic(client.clone(), &ar, &caps.scope).constrain_default();
#[kube(no_spec)] to support non-standard crs without a .spec; https://github.com/kube-rs/kube/pull/2071DynamicObject can now be used to perform a discovery::resolve_object lookup; https://github.com/kube-rs/kube/pull/2031Custom client can now use a customizable executor to deal with different lifestyle semantics of spans. Really hairy issue propagated through multiple repos.
Many fixes this release worth checking below. Of particular importance;
Two important ones; EOF recovery + missing init for the new (not-yet-default) StreamingList watch mode. Watcher also allows longer watches now.
Many smaller fixes to improve error handling; their accuracy, management of the Error size, and what to print.
Notable new docs on advanced finalizer pitfalls.
As usual there's a lot of ongoing work that improves internal ergonomics and maintainability that is normally hidden from the changelog.
In particular this release, a special thank you to @daemonfire300 for the new test suite for advanced watcher specifics, which allows us to test more complicated watcher edge cases (including one of the fixes above).
impl AsyncRead/AsyncWrite by @MintSoup in https://github.com/kube-rs/kube/pull/2059no_spec attribute for CRDs without top-level spec (#1763) by @antcybersec in https://github.com/kube-rs/kube/pull/2071hyper::rt::Executor by @cratelyn in https://github.com/kube-rs/kube/pull/2103hyper-timeout's reset_reader_on_write config by @ggevay in https://github.com/kube-rs/kube/pull/2111Full Changelog: https://github.com/kube-rs/kube/compare/4.2.0...5.0.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
<!-- Release notes generated using configuration in .github/release.yml at 4.2.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 4.2.0 -->
Maintenance release for 4.0.0. Fixes, and https proxy. MSRV 1.89. All PRs here.
CommitError's error message by @iniw in https://github.com/kube-rs/kube/pull/2020Display messages at client, core, runtime by @doxxx93 in https://github.com/kube-rs/kube/pull/2021Sync bound in Controller::reconcile_all_on by @bojidar-bg in https://github.com/kube-rs/kube/pull/2029ObjectMeta per event in trigger_owners by @doxxx93 in https://github.com/kube-rs/kube/pull/2039CustomResourceDefinition in derived crd() by @doxxx93 in https://github.com/kube-rs/kube/pull/2042Full Changelog: https://github.com/kube-rs/kube/compare/4.0.0...4.2.0
deserialization changed from serde-yaml to `serde-saphyr` to get rid of the long-deprecated dependency. https://github.com/kube-rs/kube/pull/1975
<!-- Release notes generated using configuration in .github/release.yml at 4.0.0 -->
As per the release schedule to match up with the latest Kubernetes ハル release. Lots of fixes and improvements. Thanks to everyone who contributed!
v1_36 support via k8s-openapi 0.28Please upgrade k8s-openapi along with kube to avoid conflicts.
A new optional crate kube-cel is being re-exported through kube::core::cel via https://github.com/kube-rs/kube/pull/1954
Kubernetes CRDs support CEL validation rules via x-kubernetes-validations, and were supported from 3.0 via KubeSchema, but these rules could only be evaluated server-side by the API server.
The new crate allows evaluating these rules locally using rules matching the upstream Kubernetes CEL libraries.
While low-level, a higher-level CEL validator integrates with CustomResource via #[kube(cel)] from https://github.com/kube-rs/kube/pull/2011 and can be used as;
#[derive(CustomResource, Serialize, Deserialize, Clone, KubeSchema)]
#[kube(group = "example.com", version = "v1", kind = "Foo", namespaced)]
#[kube(cel, validation = "self.spec.replicas >= 0")] // cel trigger + validation rule
struct FooSpec { replicas: i32 }
let foo = Foo::new("test", FooSpec { replicas: -1 });
foo.validate_cel()?; // new impl; checks creation rules
new_foo.validate_cel_update(&old_foo)?; // new impl; checks transition rules
See examples/crd_derive_cel.rs for more details.
This is available under the kube/cel feature, courtesy of @doxxx93.
A lot of improvements to config handling;
Kubeconfig fields in https://github.com/kube-rs/kube/pull/1965Kubeconfig future key compatibility for new fields by adding catch-all other key via https://github.com/kube-rs/kube/pull/1964serde-yaml to serde-saphyr to get rid of the long-deprecated dependency. https://github.com/kube-rs/kube/pull/1975Better timeout and retry handling to better deal with flaky network conditions, and busy or initializing apiservers.
watcher level timeouts in https://github.com/kube-rs/kube/pull/1945 (see https://github.com/kube-rs/kube/issues/1798 for context)RetryPolicy - now enabled by default in https://github.com/kube-rs/kube/pull/2007.tls-server-name with openssl-tls via https://github.com/kube-rs/kube/pull/1993yaml output from exec plugins via https://github.com/kube-rs/kube/pull/2003ws task leak and drop, and a deadlock on join() via https://github.com/kube-rs/kube/pull/1978watcher automatically uses the metadata_ api methods when called with PartialObjectMeta<K> via https://github.com/kube-rs/kube/pull/1952
metadata_watcher in favor of an explicit change from Api::<K> to Api::<PartialObjectMeta<K>>)wait::conditions::is_created as a counter to is_deleted https://github.com/kube-rs/kube/pull/2000Store::state_filtered and Store::state_filter_selector to allow more efficient slicing of the locked cache via https://github.com/kube-rs/kube/pull/2002 + https://github.com/kube-rs/kube/pull/1998AdmissionRequest::to_cel_request() for VAP CEL bridging by @doxxx93 in https://github.com/kube-rs/kube/pull/1991Store::state_with and Store::state_filtered by @Alvov1 in https://github.com/kube-rs/kube/pull/1998wait::conditions::is_created helper by @orangecms in https://github.com/kube-rs/kube/pull/2000RetryPolicy::server_retry by default for Client by @Danil-Grigorev in https://github.com/kube-rs/kube/pull/2007Full Changelog: https://github.com/kube-rs/kube/compare/3.1.0...4.0.0
<!-- Release notes generated using configuration in .github/release.yml at 3.1.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 3.1.0 -->
Maintenance release with fixes for schemas/validation, client exec blocking and proxy handling, as well as some smaller new features listed below. Internal changes and documentation improvements listed in the milestone.
Rule by @Immortal-Beyond-Oblivion in https://github.com/kube-rs/kube/pull/1947Full Changelog: https://github.com/kube-rs/kube/compare/3.0.1...3.1.0
<!-- Release notes generated using configuration in .github/release.yml at 3.0.1 -->
<!-- Release notes generated using configuration in .github/release.yml at 3.0.1 -->
Bugfix release for schemas, admission, and docs. Minor internal improvements listed in the milestone. Important fixes below.
AdmissionResponse created via invalid call by @Magicloud in https://github.com/kube-rs/kube/pull/1905OptionalEnum transform skipping schemas with description by @doxxx93 in https://github.com/kube-rs/kube/pull/1908additionalProperties: false from schema by @doxxx93 in https://github.com/kube-rs/kube/pull/1920Full Changelog: https://github.com/kube-rs/kube/compare/3.0.0...3.0.1
This creates a small breaking change for users matching on specific `Error::Api` codes;
<!-- Release notes generated using configuration in .github/release.yml at 3.0.0 -->
As per the new release schedule to match up with the new Kubernetes release. Lots of additions, fixes and improvements. Thanks to everyone who contributed so heavily over the holidays! Happy new year.
v1_35 support via k8s-openapi 0.27Please upgrade k8s-openapi along with kube to avoid conflicts.
jiff replaces chronoMatching k8s-openapi's change, kube has also swapped out chrono. The biggest impact of this is for interacting with timestamps in metadata, but it also updates 2 smaller public interfaces in LogParams, Client::with_valid_until. See controller-rs#217 for an example change.
Changes: https://github.com/kube-rs/kube/pull/1868 + https://github.com/kube-rs/kube/pull/1870
ErrorResponse has been replaced with StatusErrorResponse served as a partial metav1/Status replacement which ended up hiding error information to users. These structs have merged, more information is available on errors, and a type alias with a deprecation warning is in place for ErrorResponse which will be removed in a later version.
This creates a small breaking change for users matching on specific Error::Api codes;
.map_err(|error| match error {
- kube::Error::Api(kube::error::ErrorResponse { code: 403, .. }) => {
- Error::UnauthorizedToPatch(obj)
- }
+ kube::Error::Api(s) if s.is_forbidden() => Error::UnauthorizedToPatch(obj),
other => Error::Other(other),
})?;
https://github.com/kube-rs/kube/pull/1875 + https://github.com/kube-rs/kube/pull/1883 + https://github.com/kube-rs/kube/pull/1891.
This prevents unbounded memory for controllers, particularly affecting ones watching quickly rotating objects with generated names (e.g. pods). By default the TTL is 1h. It can be configured via new PredicateConfig parameter. To use the default;
- .predicate_filter(predicates::resource_version);
+ .predicate_filter(predicates::resource_version, Default::default());
Change in https://github.com/kube-rs/kube/pull/1836. This helped expose and fix a bug in watches with streaming_lists now fixed in https://github.com/kube-rs/kube/pull/1882.
Some subresource write methods were public with inconsistent signatures that required less ergonomic use than any other write methods. They took a Vec<u8> for the post body, now they take a &K: Serialize or the actual subresource.
There affect Api::create_subresource, Api::replace_subresource, Api::replace_status, Api::replace_scale. In essence this generally means you do not have to wrap raw objects in json! and serde_json::to_vec for these calls and lean more on rust's typed objects rather than json! blobs which has some footguns for subresources.
- let o = foos.replace_status("qux", &pp, serde_json::to_vec(&object)?).await?;
+ let o = foos.replace_status("qux", &pp, &object).await?;
See some more shifts in examples in the implementaion; https://github.com/kube-rs/kube/pull/1884
Speeds up api discovery significantly by using the newer api with much less round-tripping.
To opt-in change Discovery::run() to Discovery::run_aggregated()
Changes; https://github.com/kube-rs/kube/pull/1876 + https://github.com/kube-rs/kube/pull/1873 + https://github.com/kube-rs/kube/pull/1889
RetryPolicy opt-inAllows custom clients (for now) to enable exponential backoff'd retries for retryable errors by exposing a tower::retry::Policy for a tower::retry::Layer. See the new custom_client_retry example for details.
Enabled by a clonable body + the new RetryPolicy based on mirrord's solution*.
While this is mostly for internal ergonomics, we would like to highlight this also simplifies the Condition implementors which had to deal with a lot of options;
pub fn is_job_completed() -> impl Condition<Job> {
|obj: Option<&Job>| {
- if let Some(job) = &obj {
- if let Some(s) = &job.status {
- if let Some(conds) = &s.conditions {
- if let Some(pcond) = conds.iter().find(|c| c.type_ == "Complete") {
- return pcond.status == "True";
- }
- }
- }
+ if let Some(job) = &obj
+ && let Some(s) = &job.status
+ && let Some(conds) = &s.conditions
+ && let Some(pcond) = conds.iter().find(|c| c.type_ == "Complete")
+ {
+ return pcond.status == "True";
Change https://github.com/kube-rs/kube/pull/1856 + https://github.com/kube-rs/kube/pull/1792
Resize subresource impl for Pod - https://github.com/kube-rs/kube/pull/1851#[kube(attr="...") to allow custom attrs on derives - https://github.com/kube-rs/kube/pull/1850Resize subresource for Pod by @hugoponthieu in https://github.com/kube-rs/kube/pull/1851try_clone method for kube_client::client::Body when it's Kind::Once by @meowjesty in https://github.com/kube-rs/kube/pull/1867predicate_filter by @doxxx93 in https://github.com/kube-rs/kube/pull/1838chrono with jiff by @ngergs in https://github.com/kube-rs/kube/pull/1868k8s-openapi for Kubernetes 1.35 by @clux in https://github.com/kube-rs/kube/pull/1898Full Changelog: https://github.com/kube-rs/kube/compare/2.0.1...3.0.0
<!-- Release notes generated using configuration in .github/release.yml at 2.0.1 -->
<!-- Release notes generated using configuration in .github/release.yml at 2.0.1 -->
Fixes an accidental inclusion of a constraint added to Api::log_stream introduced in the 2.0.0 Rust 2024 upgrade.
Full Changelog: https://github.com/kube-rs/kube/compare/2.0.0...2.0.1
<!-- Release notes generated using configuration in .github/release.yml at 2.0.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 2.0.0 -->
v1_34 support via k8s-openapi 0.26Please upgrade k8s-openapi along with kube to avoid conflicts.
A fairly significant upgrade in https://github.com/kube-rs/kube/pull/1780. Our external facing API should be unchanged, although some schemars public import paths have changed. Note that if you are implementing schemars traits directly, then see the upstream schemars/migrating (and maybe consider using KubeSchema for relevant schema overrides).
Please upgrade schemars along with kube for this version to avoid conflicts.
Minimum versions: MSRV 1.85.0 (for edition 2024), MK8SV: 1.30 (unchanged).
This version is contains fixes, dependency clearups, and dependency updates. Noteworthy additions are TryFrom impls for Kubeconfig users in #1801, and a namespace accessor in Api in #1788
A new semver major for unstable, public facing dependency updates. As per the new release cycle, it is aligned with the Kubernetes release.
TryFrom conversions for Kubeconfig -> Config -> Client by @Danil-Grigorev in https://github.com/kube-rs/kube/pull/1801hyper-socks2 with hyper-util client-proxy feature by @tottoto in https://github.com/kube-rs/kube/pull/1795Full Changelog: https://github.com/kube-rs/kube/compare/1.1.0...2.0.0
<!-- Release notes generated using configuration in .github/release.yml at 1.1.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 1.1.0 -->
Missing attribute bugfix + extra standard derives on core::conversion structs.
#[schemars(crate)] attribute by @Techassi in https://github.com/kube-rs/kube/pull/1764Full Changelog: https://github.com/kube-rs/kube/compare/1.0.0...1.1.0
This is a somewhat symbolic gesture, because semver-breaking changes are still hard to avoid with a large set of sub-1.0 dependencies we need to bump,…
<!-- Release notes generated using configuration in .github/release.yml at 1.0.0 -->
It's been a long time coming, but time has come to draw the line in the sand. No alphas, no betas. Hope it finds you all well. Thanks to everyone who has contributed over the years.
This is a somewhat symbolic gesture, because semver-breaking changes are still hard to avoid with a large set of sub-1.0 dependencies we need to bump, as well as managing the large api surface of Kubernetes.
Therefore, the plan is to align our breaking changes and major bumps with Kubernetes versions / k8s-openapi versions for now, and this should allow our other releases to stream in. See https://github.com/kube-rs/kube/issues/1688 for more information.
v1_33 support via k8s-openapi 0.25Please upgrade k8s-openapi along with kube to avoid conflicts.
New minimum versions: MSRV 1.82.0, MK8SV: 1.30*
The CELSchema alternate derive for JsonSchema has been renamed to KubeSchema to indicate the increased functionality.
In addition to being able to inject CEL rules for validations, it can now also inject x-kubernetes properties such as merge-strategy via https://github.com/kube-rs/kube/pull/1750, handle #[validate] attributes https://github.com/kube-rs/kube/pull/1749, and pass validation rules as string literals https://github.com/kube-rs/kube/pull/1754 :
#[derive(CustomResource, Serialize, Deserialize, Debug, PartialEq, Clone, KubeSchema)]
#[kube(...properties)
struct DocumentSpec {
/// New merge strategy support
#[x_kube(merge_strategy = ListMerge::Set)]
x_kubernetes_set: Vec<String>,
/// CEL Validation now lives on x_kube and supports literal Rules:
#[x_kube(validation = "!has(self.variantOne) || self.variantOne.int > 22")]
complex_enum: ComplexEnum,
}
See kube.rs docs on validation for more info. Huge thanks to @Danil-Grigorev.
hyper-util/tracing feature flag by @cratelyn in https://github.com/kube-rs/kube/pull/1734x-kubernetes-* schema extensions by @Danil-Grigorev in https://github.com/kube-rs/kube/pull/1750k8s-openapi to 0.25.0 by @clux in https://github.com/kube-rs/kube/pull/1756watcher::Event into_iter_* methods by @clux in https://github.com/kube-rs/kube/pull/1738CELSchema by @Danil-Grigorev in https://github.com/kube-rs/kube/pull/1747CELSchema by @Danil-Grigorev in https://github.com/kube-rs/kube/pull/1749Full Changelog: https://github.com/kube-rs/kube/compare/0.99.0...1.0.0
…and [#[kube(deprecated)]](https://docs.rs/kube/latest/kube/derive.CustomResource.html#kubedeprecated--warning) in https://github.com/kube-rs/kube/pull…
<!-- Release notes generated using configuration in .github/release.yml at 0.99.0 -->
backoff (unmaintained) replaced with backon in https://github.com/kube-rs/kube/pull/1653
default_backoff natively, or through Controller.ExponentialBackoff from backon::ExponentialBuilder into WatchStreamExt::backoffjson-patch bumped and uses re-exported jsonptr for less version clashes https://github.com/kube-rs/kube/pull/1718rand dependency no longer explicit as only rng is under ws feature via tungstenite's client::generate_key https://github.com/kube-rs/kube/pull/1691ring (still maintained) now optional for rustls-tls feature (for alternate aws-lc-rs) https://github.com/kube-rs/kube/pull/1717v5.channel.k8s.io streaming ws protocol to allow closing streams properly (kubernetes.io blog) https://github.com/kube-rs/kube/pull/1693CustomResource derive; typed attributes for #[kube(scale)] and #[kube(deprecated)] in https://github.com/kube-rs/kube/pull/1656 + https://github.com/kube-rs/kube/pull/1697Client::with_valid_until to handle short lived local client certs https://github.com/kube-rs/kube/pull/1707conditions that can be awaited https://github.com/kube-rs/kube/pull/1710Api::get_metadata_opt_with by @sebsoto in https://github.com/kube-rs/kube/pull/1708Client::with_valid_until for client cert expiry by @goenning in https://github.com/kube-rs/kube/pull/1707ExponentialBackoff public by @gdeleon2 in https://github.com/kube-rs/kube/pull/1716backoff with backon by @flavio in https://github.com/kube-rs/kube/pull/1653rand to 0.9 by @clux in https://github.com/kube-rs/kube/pull/1686rand dependency in favor of tungstenite fn by @clux in https://github.com/kube-rs/kube/pull/1691json-patch to 4 use bundled jsonptr to 0.7 by @clux in https://github.com/kube-rs/kube/pull/1718CustomResource derive; allow status attribute to take a path by @clux in https://github.com/kube-rs/kube/pull/1704Full Changelog: https://github.com/kube-rs/kube/compare/0.98.0...0.99.0
kube-runtime event `Recorder` now aggregates repeat events #1655 (some breaking changes, see controller-rs#116)
<!-- Release notes generated using configuration in .github/release.yml at 0.98.0 -->
v1_32 support via k8s-openapi 0.24
kube-derive additions:
CELSchema derive macro wrapper around JsonSchema for injecting cel validations into the schema #1649served and storage booleans for multiple versions of CustomResource derives: #1644kube-runtime event Recorder now aggregates repeat events #1655 (some breaking changes, see controller-rs#116)kube-client UTF-16 edge case handling for windows #1654storage and served argument to derive macro by @Techassi in https://github.com/kube-rs/kube/pull/1644derive(CELSchema) macro for generating cel validation on CRDs by @Danil-Grigorev in https://github.com/kube-rs/kube/pull/1649runtime event recorder by @pando85 in https://github.com/kube-rs/kube/pull/1655k8s-openapi for Kubernetes v1_32 support and MSRV by @clux in https://github.com/kube-rs/kube/pull/1671Full Changelog: https://github.com/kube-rs/kube/compare/0.97.0...0.98.0
<!-- Release notes generated using configuration in .github/release.yml at 0.97.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.97.0 -->
CustomResource derive added features for crd yaml output:
aws-lc-rs (rustls crypto) provider #1617null user; #1608client-go #1603gzip via Config #1627thiserror, hashbrown, jsonptr, json-patch. Killed lazy_static / once_cellaws-lc-rs by @goenning in https://github.com/kube-rs/kube/pull/1617Full Changelog: https://github.com/kube-rs/kube/compare/0.96.0...0.97.0
<!-- Release notes generated using configuration in .github/release.yml at 0.96.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.96.0 -->
webpki-roots added #1323, and predicates no longer require unstable-runtime #1578tower and secrecy, and derivative swapped for educeObjectRef::from as alias for ::from_obj by @nightkr in https://github.com/kube-rs/kube/pull/1598secrecy to 0.10 by @clux in https://github.com/kube-rs/kube/pull/1588tower to 0.5.1 by @markdingram in https://github.com/kube-rs/kube/pull/1589Full Changelog: https://github.com/kube-rs/kube/compare/0.95.0...0.96.0
<!-- Release notes generated using configuration in .github/release.yml at 0.95.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.95.0 -->
v1_31 support via k8s-openapi 0.23Please upgrade k8s-openapi along with kube to avoid conflicts.
New minimum versions: MSRV 1.77.2, MK8SV: 1.26
k8s-openapi to 0.23 for Kubernetes 1.31 support by @clux in https://github.com/kube-rs/kube/pull/1581Full Changelog: https://github.com/kube-rs/kube/compare/0.94.2...0.95.0
<!-- Release notes generated using configuration in .github/release.yml at 0.94.2 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.94.2 -->
Fixes a runtime regression in watch_object.
watch_object handles objects removed before init by @markdingram in https://github.com/kube-rs/kube/pull/1577Full Changelog: https://github.com/kube-rs/kube/compare/0.94.1...0.94.2
<!-- Release notes generated using configuration in .github/release.yml at 0.94.1 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.94.1 -->
Convenience release. Adjusted a version bound to avoid possibility of running into version compatibility errors with hyper-rustls.
Full Changelog: https://github.com/kube-rs/kube/compare/0.94.0...0.94.1
<!-- Release notes generated using configuration in .github/release.yml at 0.94.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.94.0 -->
Support for rustls's aws-lc-rs is available under a new kube/aws-lc-rs feature. Via https://github.com/kube-rs/kube/pull/1568 for https://github.com/kube-rs/kube/issues/1562
Furthermore, there are features to help avoid dynamic typing:
DeserializeGuard safety wrapper to lift deserialisation errors (to e.g. not break watchers). See the errorbound example and core module module. Wrapped type be used with e.g. Api::<DeserializeGuard<CaConfigMap>>. Via https://github.com/kube-rs/kube/pull/1556Resource; #[derive(Resource)] allows inheriting existing k8s-openapi resource implementations to avoid stepping down to the dynamic api. See the cert check example for usage. Via https://github.com/kube-rs/kube/pull/1565aws-lc-rs rustls feature by @mcluseau in https://github.com/kube-rs/kube/pull/1568Resource derive macro by @Danil-Grigorev in https://github.com/kube-rs/kube/pull/1565Full Changelog: https://github.com/kube-rs/kube/compare/0.93.1...0.94.0
<!-- Release notes generated using configuration in .github/release.yml at 0.93.1 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.93.1 -->
Full Changelog: https://github.com/kube-rs/kube/compare/0.93.0...0.93.1
runtime: remove deprecated default_backoff by @clux in https://github.com/kube-rs/kube/pull/1518
<!-- Release notes generated using configuration in .github/release.yml at 0.93.0 -->
Better query validation, better client header customisation, and two new modules:
core::labels module for creating typed label selectors for ListParams or WatchParams. Can be constructed from a native LabelSelector, or directly from a Selector of Expressions. PR.prelude to simplify imports of extension traits. PR.A big thank you to everyone who contributed to this release!
Full Changelog: https://github.com/kube-rs/kube/compare/0.92.0...0.93.0
This release fixes #1524; a regression from 0.92.0 causing watcher to skip pages on initial list. See #1525.
This release fixes #1524; a regression from 0.92.0 causing watcher to skip pages on initial list. See #1525.
It is recommended to upgrade from 0.92.0.
The downside is a breaking change to `watcher::Event`. Plain usage of watcher / reflector / Controller should generally not need to change anything, b…
<!-- Release notes generated using configuration in .github/release.yml at 0.92.0 -->
watcherBuffering of initial pages / init streams is no longer a mandatory process with watcher::Event gaining new Init, InitApply, and InitDone events. These events are read on the store side maintaining the atomicity/completeness guarantees for reflector and Store users.
This constitutes a significant memory decrease for all watcher users, and it has more details in a new kube.rs/blog post.
The downside is a breaking change to watcher::Event. Plain usage of watcher / reflector / Controller should generally not need to change anything, but custom stores / matches on watcher::Event will need an update. If you are writing custom stores, the new signals should be helpful for improved caching.
Thanks to @fabriziosestito via Kubewarden for https://github.com/kube-rs/kube/pull/1494 . Follow-ups for this feature: https://github.com/kube-rs/kube/pull/1499 and https://github.com/kube-rs/kube/pull/1504.
Support is now introduced under the http-proxy feature pulling in hyper-http-proxy complementing the already existing socks5 proxy feature.
Thanks to @aviramha via MetalBear for the support in https://github.com/kube-rs/kube/pull/1496, with follow-ups https://github.com/kube-rs/kube/pull/1501 + https://github.com/kube-rs/kube/pull/1502
tokio-tungstenite to 0.23 by @Toasterson in https://github.com/kube-rs/kube/pull/1509watcher::Event init/page variants by @clux in https://github.com/kube-rs/kube/pull/1504hyper-proxy2 to hyper-http-proxy by @aviramha in https://github.com/kube-rs/kube/pull/1502Full Changelog: https://github.com/kube-rs/kube/compare/0.91.0...0.92.0
<!-- Release notes generated using configuration in .github/release.yml at 0.91.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.91.0 -->
v1_30 support via k8s-openapi 0.22Please upgrade k8s-openapi along with kube to avoid conflicts.
A more complete implementation that allows sharing watcher streams between multiple Controllers (for https://github.com/kube-rs/kube/issues/1080) has been added under the unstable-runtime feature-flag in #1449 and #1483 by @mateiidavid. This represents the first usable implementation of shared streams (and replaces the older prototype part in #1470). While some changes are expected, you can check the shared_stream_controller example for a high-level overview.
k8s-openapi to 0.22 and bump MK8SV to 1.25 by @clux in https://github.com/kube-rs/kube/pull/1485StreamSubscribe implementation by @clux in https://github.com/kube-rs/kube/pull/1470uniqueItems property from CRDs when Sets are used by @sbernauer in https://github.com/kube-rs/kube/pull/1484Full Changelog: https://github.com/kube-rs/kube/compare/0.90.0...0.91.0
<!-- Release notes generated using configuration in .github/release.yml at 0.90.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.90.0 -->
kube::client::Body Improvementssize_hint and is_end_stream implemented in #1452 + internal cleanups #1453 and #1455rustls to 0.23 in #1457once_cell removed in #1447 (no longer needed)futures feature prune in #1442chrono features prune in #1448, and bump its min version pin in #1458Body::collect_bytes for easier unit tests by @clux in https://github.com/kube-rs/kube/pull/1445rustls 0.23 by @tottoto in https://github.com/kube-rs/kube/pull/1457futures feature by @tottoto in https://github.com/kube-rs/kube/pull/1442Body::empty for easier tests by @clux in https://github.com/kube-rs/kube/pull/1444once_cell Lazy with ordinary static by @tottoto in https://github.com/kube-rs/kube/pull/1447chrono feature clock with now by @tottoto in https://github.com/kube-rs/kube/pull/1448http_body trait method by @tottoto in https://github.com/kube-rs/kube/pull/1452chrono version by @clux in https://github.com/kube-rs/kube/pull/1458Full Changelog: https://github.com/kube-rs/kube/compare/0.89.0...0.90.0
<!-- Release notes generated using configuration in .github/release.yml at 0.89.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.89.0 -->
hyper and http to 1.0 and MSRV to 1.75.0This release completes the hyper & http ecosystem upgrade #1351 via #1438. In particular, this change includes upgrades to http, http-body, tower-http, hyper, hyper-openssl, hyper-rustls, hyper-socks2, hyper-timeout, tame-oauth, tokio-tungstenite, tower-http, rustls, rustls-pemfile, as well as adopting the new hyper_util and http_body_util to make the change.
While this change constitutes significant internal churn (and a new kube::client::Body), our external api remains largely unchanged. Some minor changes are necessary for custom clients, and for integration testing using tower_mock. See the controller-rs upgrade pr or the examples folder in this commit for details.
Client::get and Client::list by @clux in https://github.com/kube-rs/kube/pull/13751.75.0 by @clux in https://github.com/kube-rs/kube/pull/1408reflector to only request identifying metadata by @SOF3 in https://github.com/kube-rs/kube/pull/1393jsonpath-rust to 0.5.0 by @clux in https://github.com/kube-rs/kube/pull/1429Kubeconfig allow certificate_authority_data not present in ExecAuthCluster by @ljun20160606 in https://github.com/kube-rs/kube/pull/1432Client::request_stream by @XciD in https://github.com/kube-rs/kube/pull/1433Full Changelog: https://github.com/kube-rs/kube/compare/0.88.1...0.89.0
<!-- Release notes generated using configuration in .github/release.yml at 0.88.1 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.88.1 -->
This is a bug fix release for a deserialization issue introduced in 0.88.0.
ObjectList by @flavio in https://github.com/kube-rs/kube/pull/1398Full Changelog: https://github.com/kube-rs/kube/compare/0.88.0...0.88.1
<!-- Release notes generated using configuration in .github/release.yml at 0.88.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.88.0 -->
v1_29 support via k8s-openapi 0.21Please upgrade k8s-openapi along with kube to avoid conflicts.
k8s-openapi for Kubernetes v1_29 support by @clux in https://github.com/kube-rs/kube/pull/1394Full Changelog: https://github.com/kube-rs/kube/compare/0.87.2...0.88.0
<!-- Release notes generated using configuration in .github/release.yml at 0.87.2 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.87.2 -->
LogParams::since_time by @clux in https://github.com/kube-rs/kube/pull/1342jsonpath_lib to jsonpath-rust by @ilya-bobyr in https://github.com/kube-rs/kube/pull/1345Full Changelog: https://github.com/kube-rs/kube/compare/0.87.1...0.87.2
<!-- Release notes generated using configuration in .github/release.yml at 0.87.1 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.87.1 -->
Controller issue with reconciliation requests disappearing when using concurrency #1324Client with better exec auth behaviour #1320, timeout control #1314, and socks5 proxy handling #1311syn 2 #1307Big thanks to everyone involved 🎃
socks5 proxy in Client by @Razz4780 in https://github.com/kube-rs/kube/pull/1311Controller::reconcile_on and remove Err input requirement by @clux in https://github.com/kube-rs/kube/pull/1304base64 to 0.21 by @clux in https://github.com/kube-rs/kube/pull/1308darling and syn and rename #[kube(struct)] by @clux in https://github.com/kube-rs/kube/pull/1307KUBERNETES_EXEC_INFO environment variable passed to auth plugins by @Razz4780 in https://github.com/kube-rs/kube/pull/1320Controller: pending messages are stuck in the scheduled map by @co42 in https://github.com/kube-rs/kube/pull/1324Full Changelog: https://github.com/kube-rs/kube/compare/0.86.0...0.87.1
adds watch-list implementation without breaking changes by @casualjim in https://github.com/kube-rs/kube/pull/1255
<!-- Release notes generated using configuration in .github/release.yml at 0.86.0 -->
v1_28Please note upstream api removals. As usual, upgrade k8s-openapi along with kube to avoid issues.
rustlsWith last year's upstream changes from rustls (closing all our existing rustls issues - see https://github.com/kube-rs/kube/issues/1192), this is now the better choice for security, features, and ease of building. The previous default openssl stack can still be used with default-features = false plus the openssl-tls feature.
A controller Config has been added to allow tweaking two behaviour parameters (debouncing in #1265 and concurrency limits in #1277) of the Controller. Huge thanks to @aryan9600 for his work.
The sendInitialEvents alpha feature is now supported, and is quickly testable in the pod_watcher example when using the feature gate. This will help optimise the memory profile of controllers when the feature becomes generally available. Amazing work by first time contributor @casualjim.
controller::Config and debounce period to scheduler by @aryan9600 in https://github.com/kube-rs/kube/pull/1265rustls-tls by @clux in https://github.com/kube-rs/kube/pull/1261core: omit invalid resource version parameters when doing paged requests by @goenning in https://github.com/kube-rs/kube/pull/1281Full Changelog: https://github.com/kube-rs/kube/compare/0.85.0...0.86.0
<!-- Release notes generated using configuration in .github/release.yml at 0.85.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.85.0 -->
This release brings in the new k8s-openapi release.
Be sure to upgrade k8s-openapi and kube simultaneously to avoid multiple version errors:
cargo upgrade -p k8s-openapi -p kube -i
WatchStreamExt::reflect to allow chaining on a reflector by @clux in https://github.com/kube-rs/kube/pull/1252dirs-next dependency to cargo-team maintained home crate by @utkarshgupta137 in https://github.com/kube-rs/kube/pull/1207k8s-openapi to 0.19.0 for v1_27 support by @clux in https://github.com/kube-rs/kube/pull/1271watcher: return NoResourceVersion error if resource version is empty by @aryan9600 in https://github.com/kube-rs/kube/pull/1259scheduler message when preponing by @nightkr in https://github.com/kube-rs/kube/pull/1260Full Changelog: https://github.com/kube-rs/kube/compare/0.84.0...0.85.0
<!-- Release notes generated using configuration in .github/release.yml at 0.84.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.84.0 -->
On the runtime side, the Controller now delays reconciles until the main Store is ready (via a new Store helper from #1243). The stream selection for owned resources is more efficient (#1240), and the underlying watcher streams now all paginate (#1249). There are also many new WatchStreamExt helpers ( #1246 + #1228 + #1232) as a continued work towards the more customisable streams-api (#1080).
On the client-side; streaming logs are now easier to deal with as an AsyncBufRead #1235.
Optional OIDC refreshable token support was introduced in #1229 under kube/oidc for out-of-cluster Client configuration. Previously, refresh support was limited to non-OIDC tokens from the GcpOuth provider (kube/oauth) or through arbitrary exec calls / TokenFile loading.
Predicate trait to allow combination + fallbacks by @clux in https://github.com/kube-rs/kube/pull/1228WatchStreamExt::default_backoff shorthand by @clux in https://github.com/kube-rs/kube/pull/1232PartialEq on core params structs by @danrspencer in https://github.com/kube-rs/kube/pull/1237WatchStreamExt::modify() to modify events by @aryan9600 in https://github.com/kube-rs/kube/pull/1246watcher by @clux in https://github.com/kube-rs/kube/pull/1249Api::log_stream to return AsyncBufRead by @aryan9600 in https://github.com/kube-rs/kube/pull/1235Controller::owns use metadata_watcher internally by @clux in https://github.com/kube-rs/kube/pull/1240Full Changelog: https://github.com/kube-rs/kube/compare/0.83.0...0.84.0
<!-- Release notes generated using configuration in .github/release.yml at 0.83.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.83.0 -->
Controller::reconcile_on by @co42 in https://github.com/kube-rs/kube/pull/1163predicates::resource_version by @clux in https://github.com/kube-rs/kube/pull/1221Duration to kube-core by @hawkw in https://github.com/kube-rs/kube/pull/1224GetParams support by @mateiidavid in https://github.com/kube-rs/kube/pull/1214validator for garde by @mateiidavid in https://github.com/kube-rs/kube/pull/1212#[kube(crates(serde = "some_crate::serde"))] was not working by @chubei in https://github.com/kube-rs/kube/pull/1215Full Changelog: https://github.com/kube-rs/kube/compare/0.82.2...0.83.0
<!-- Release notes generated using configuration in .github/release.yml at 0.82.2 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.82.2 -->
Two fixes to allow watcher::Config to function as intended.
runtime::watcher: only set rv if semantic is any by @goenning in https://github.com/kube-rs/kube/pull/1204watcher::Config: Derive Clone + Debug + PartialEq by @clux in https://github.com/kube-rs/kube/pull/1206Full Changelog: https://github.com/kube-rs/kube/compare/0.82.1...0.82.2
<!-- Release notes generated using configuration in .github/release.yml at 0.82.1 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.82.1 -->
nullable is re-instated on Option types from CustomResource generated schemas, due to unintended errors removing it caused on Api::patch calls on None members that were not setting #[serde(skip_serializing_if = "Option::is_none")]. This only affected 0.81 and 0.82 from last week, and does not require user action regardless of where you are upgrading from.
This release also fixes a metadata_watcher triggering deserialization error from doing Api::list_metadata on an empty set.
WatchParams bookmarks for watch_metadata by @clux in https://github.com/kube-rs/kube/pull/1193ObjectList not deserializing items: null by @suryapandian in https://github.com/kube-rs/kube/pull/1199option_nullable for CRD generation" by @Dav1dde in https://github.com/kube-rs/kube/pull/1201Full Changelog: https://github.com/kube-rs/kube/compare/0.82.0...0.82.1
<!-- Release notes generated using configuration in .github/release.yml at 0.82.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.82.0 -->
This release brings in the new k8s-openapi release.
Be sure to upgrade k8s-openapi and kube simultaneously to avoid multiple version errors:
cargo upgrade -p k8s-openapi -p kube -i
serde_yaml to 0.9 by @clux in https://github.com/kube-rs/kube/pull/1188k8s-openapi to 0.18.0 by @clux in https://github.com/kube-rs/kube/pull/1190Full Changelog: https://github.com/kube-rs/kube/compare/0.81.0...0.82.0
All rustls specific overrides (such as using the deprecated incluster_dns strategy for configuration #1184) have been removed as a result.
<!-- Release notes generated using configuration in .github/release.yml at 0.81.0 -->
One big change is the splitting of ListParams into ListParams and WatchParams in #1162 and #1171. If you were using api.list directly, this should not affect you, but api.watch calls will need a replace of ListParams to WatchParams. Apart from the resulting field splitting, the two structs still have a mostly compatible api.
If you were passing ListParams to watcher or Controller, you can change this for a new watcher::Config with a mostly compatible interface:
- let stream = watcher(api, ListParams::default());
+ let stream = watcher(api, watcher::Config::default());
The reason for this change has been to add support for specific version match strategies and has new builders on both ListParams and watcher::Config to control the strategy. Using the new VersionMatch::NotOlderThan can reduce strain on the apiserver for individual api.list calls. Watchers will benefit the most from this, and should consider using the semantic Any strategy (= NotOlderThan with version "0") on all relists by setting watcher::Config::any_semantic().
This release closes all our rustls issues as a consequence of the long standing IP address incompatibility (#153) having been resolved upstream. All rustls specific overrides (such as using the deprecated incluster_dns strategy for configuration #1184) have been removed as a result.
Multiple new runtime features have been added to be able to more precisely control the input streams used by Controller a starting step towards stream sharing (#1080) and as a way to reduce excess input events. Because these interfaces are likely to remain in flux for some time, these are only available under unstable feature flags.
predicates to allow filtering watcher streams by @clux in https://github.com/kube-rs/kube/pull/911Controller::owns_stream by @Dav1dde in https://github.com/kube-rs/kube/pull/1173Controller::for_stream + Controller::watches_stream by @clux in https://github.com/kube-rs/kube/pull/1187ListParams and WatchParams by @nabokihms in https://github.com/kube-rs/kube/pull/1162VersionMatch follow upstream + configure list semantics in watcher::Config by @clux in https://github.com/kube-rs/kube/pull/1171option_nullable for CRD generation by @Dav1dde in https://github.com/kube-rs/kube/pull/1079rustls CI against IP cluster address by @clux in https://github.com/kube-rs/kube/pull/1183Config::incluster behavior for rustls by @clux in https://github.com/kube-rs/kube/pull/1184Full Changelog: https://github.com/kube-rs/kube/compare/0.80.0...0.81.0
<!-- Release notes generated using configuration in .github/release.yml at 0.80.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.80.0 -->
The PartialObjectMeta struct has been changed to allow static dispatch through a new generic parameter. It comes with a new PartialObjectMetaExt trait to help construct it.
Early release for the above change to the new metadata api, plus a trigger for our currently broken docs.rs.
PartialObjectMeta over the underlying Resource by @clux in https://github.com/kube-rs/kube/pull/1152Full Changelog: https://github.com/kube-rs/kube/compare/0.79.0...0.80.0
<!-- Release notes generated using configuration in .github/release.yml at 0.79.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.79.0 -->
A big feature this time around is the added support for the metadata api via #1137. This is a variant api that only returns the ObjectMeta and TypeMeta to reduce network load, and has a low-level watch analogue available at Api::watch_metadata. Most users will generally want an infinite watch stream rather than the low-level method, so kube::runtime::metadata_watcher has been added as a direct analogue of watcher via #1145. The dynamic_watcher example shows how to switch between the two to get up and running.
The watcher also emits warnings now when HTTP 403s are encountered from Kubernetes, as this usually indicates a non-transient misconfiguration that must be fixed on the administrator side with RBAC.
Finally, there is work in progress on shared streams via WatchStreamExt from #1131 under an unstable feature.
default_namespace() by @jpmcb in https://github.com/kube-rs/kube/pull/1123WatchStreamExt::subscribe by @danrspencer in https://github.com/kube-rs/kube/pull/1131Config: make cluster/users/clusters optional by @goenning in https://github.com/kube-rs/kube/pull/1120Full Changelog: https://github.com/kube-rs/kube/compare/0.78.0...0.79.0
Remove deprecated Config::timeout by @clux in https://github.com/kube-rs/kube/pull/1113
<!-- Release notes generated using configuration in .github/release.yml at 0.78.0 -->
This release brings in the new k8s-openapi release for 1.26 structs, and sets our MK8SV to 1.21.
Be sure to upgrade k8s-openapi and kube simultaneously to avoid multiple version errors:
cargo upgrade -p k8s-openapi -p kube -i
Store by @eliad-wiz in https://github.com/kube-rs/kube/pull/1111k8s-openapi@0.17.0 and MK8SV by @clux in https://github.com/kube-rs/kube/pull/1116Config::timeout by @clux in https://github.com/kube-rs/kube/pull/1113Full Changelog: https://github.com/kube-rs/kube/compare/0.77.0...0.78.0
Remove deprecated ResourceExt::name by @clux in https://github.com/kube-rs/kube/pull/1105
<!-- Release notes generated using configuration in .github/release.yml at 0.77.0 -->
This release saw numerous improvements across various parts of the codebase with lots of help from external contributors. Look for improvements in error handling, client exec behaviour, dynamic object conversion, certificate handling, and last, but not least; lots of enhancements in the config module. Huge thanks to everyone who contributed!
Config EnhancementsKubeconfigs relying on ExecConfig for auth should now work with a lot more cases (with improvements to script interactivity, cert passing, env-drop, and windows behaviour). We further aligned our Kubeconfig parsing with client-go's behaviour, and also exposed Kubeconfig::merge. Finally, we now pass Config::tls_server_name through to the Client, which has let us include a better rustls workaround for the long-standing ip issue (enabled by default).
DynamicObjects::try_parse for typed object conversion by @jmintb in https://github.com/kube-rs/kube/pull/1061ExecConfig::drop_env to filter host evars for auth providers by @aviramha in https://github.com/kube-rs/kube/pull/1062Kubeconfig::merge fn to public. by @goenning in https://github.com/kube-rs/kube/pull/1100Config::tls_server_name and validate when using rustls by @clux in https://github.com/kube-rs/kube/pull/1104ResourceExt::name by @clux in https://github.com/kube-rs/kube/pull/1105watcher when kinds do not support watch by @clux in https://github.com/kube-rs/kube/pull/1101Full Changelog: https://github.com/kube-rs/kube/compare/0.76.0...0.77.0
These have been deprecated since 0.72, and are replaced by the equivalent WatchStreamExt methods.
<!-- Release notes generated using configuration in .github/release.yml at 0.76.0 -->
#[derive(CustomResource)] now supports schemas with untagged enumsExpanding on our existing support for storing Rust's struct enums in CRDs, Kube will now try to convert #[serde(untagged)] enums as well. Note that if the same field is present in multiple untagged variants then they must all have the same shape.
try_flatten_* functionsThese have been deprecated since 0.72, and are replaced by the equivalent WatchStreamExt methods.
Controller::watches by @Dav1dde in https://github.com/kube-rs/kube/pull/1026ApiGroup::resources_by_stability by @imuxin in https://github.com/kube-rs/kube/pull/1022try_flatten_ helpers by @clux in https://github.com/kube-rs/kube/pull/1019native-tls feature by @kazk in https://github.com/kube-rs/kube/pull/1044Full Changelog: https://github.com/kube-rs/kube/compare/0.75.0...0.76.0
<!-- Release notes generated using configuration in .github/release.yml at 0.75.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.75.0 -->
k8s-openapi to 0.16 for Kubernetes 1.25The update to k8s-openapi@0.16.0 makes this the first release with tentative Kubernetes 1.25 support. While the new structs and apis now exist, we recommend holding off on using 1.25 until a deserialization bug in the apiserver is resolved upstream. See #997 / #1008 for details.
To upgrade, ensure you bump both kube and k8s-openapi:
cargo upgrade kube k8s-openapi
Config::incluster default to connect in clusterOur previous default of connecting to the Kubernetes apiserver via kubernetes.default.svc has been reverted back to use the old environment variables after Kubernetes updated their position that the environment variables are not legacy. This does unfortunately regress on rustls support, so for those users we have included a Config::incluster_dns to work around the old rustls issue while it is open.
error_policy extensionThe error_policy fn now has access to the object that failed the reconciliation to ease metric creation / failure attribution. The following change is needed on the user side:
-fn error_policy(error: &Error, ctx: Arc<Data>) -> Action {
+fn error_policy(_obj: Arc<YourObject>, error: &Error, ctx: Arc<Data>) -> Action {
There are also a slew of ergonomics improvements, closing of gaps in subresources, adding initial support for ConversionReview, making Api::namespaced impossible to use for non-namepaced resources (a common pitfall), as well as many great fixes to the edge cases in portforwarding and finalizers. Many of these changes came from first time contributors. A huge thank you to everyone involved.
Config::auth_info public by @danrspencer in https://github.com/kube-rs/kube-rs/pull/959Client::send method public by @tiagolobocastro in https://github.com/kube-rs/kube-rs/pull/972types on AdmissionRequest and AdmissionResponse public by @clux in https://github.com/kube-rs/kube-rs/pull/977#[serde(default)] to metadata field of DynamicObject by @pbzweihander in https://github.com/kube-rs/kube-rs/pull/987create_subresource method to Api and create_token_request method to Api<ServiceAccount> by @pbzweihander in https://github.com/kube-rs/kube-rs/pull/989Action by @Sherlock-Holo in https://github.com/kube-rs/kube-rs/pull/993ConversionReview types by @MikailBag in https://github.com/kube-rs/kube-rs/pull/999Config by @goenning in https://github.com/kube-rs/kube-rs/pull/971error_policy by @felipesere in https://github.com/kube-rs/kube-rs/pull/995Config: New incluster and incluster_dns constructors by @olix0r in https://github.com/kube-rs/kube-rs/pull/1001k8s-openapi to 0.16 by @clux in https://github.com/kube-rs/kube-rs/pull/1008tracing::instrument from apply_debug_overrides by @kazk in https://github.com/kube-rs/kube-rs/pull/958Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.74.0...0.75.0
A consequence of all the policy writing and the improved clarity we have decided to deprecate the common `ResourceExt::name` helper.
<!-- Release notes generated using configuration in .github/release.yml at 0.74.0 -->
This release features smaller improvements/additions/cleanups/fixes, many of which are from new first-time contributors! Thank you everyone! The listed deadlock fix was backported to 0.73.1.
We have also been trying to clarify and prove a lot more of our external-facing guarantees, and as a result:
ResourceExt::name deprecationA consequence of all the policy writing and the improved clarity we have decided to deprecate the common ResourceExt::name helper.
This method could panic and it is unexpected for the users and bad for our consistency. To get the old functionality, you can replace any .name() call on a Kubernetes resources with .name_unchecked(); but as the name implies, it can panic (in a local setting, or during admission). We recommend you replace it with the new ResourceExt::name_any for a general identifier:
-pod.name()
+pod.name_any()
fieldValidation query parameter on patch by @phroggyy in https://github.com/kube-rs/kube-rs/pull/929conditions::is_job_completed by @clux in https://github.com/kube-rs/kube-rs/pull/935ResourceExt::name in favour of safe name_* alternatives by @clux in https://github.com/kube-rs/kube-rs/pull/945#[kube(apiextensions)] flag from kube-derive by @clux in https://github.com/kube-rs/kube-rs/pull/920Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.73.0...0.74.0
This patch release fixes a bug causing applier and Controller to deadlock when too many Kubernetes object change events were ingested at once. All use
This patch release fixes a bug causing applier and Controller to deadlock when too many Kubernetes object change events were ingested at once. All users of applier and Controller are encouraged to upgrade as quickly as possible. Older versions are also affected, this bug is believed to have existed since the original release of kube_runtime.
<!-- Release notes generated using configuration in .github/release.yml at 0.73.1 -->
Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.73.0...0.73.1
<!-- Release notes generated using configuration in .github/release.yml at 0.73.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.73.0 -->
k8s-openapi version and MSRVSupport added for Kubernetes v1_24 support via the new k8s-openapi version. Please also run cargo upgrade --workspace k8s-openapi when upgrading kube.
This also bumps our MSRV to 1.60.0.
A small ergonomic change in the reconcile signature has removed the need for the Context object. This has been replaced by an Arc. The following change is needed in your controller:
-async fn reconcile(doc: Arc<MyObject>, context: Context<Data>) -> Result<Action, Error>
+async fn reconcile(doc: Arc<MyObject>, context: Arc<Data>) -> Result<Action, Error>
This will simplify the usage of the context argument. You should no longer need to pass .get_ref() on its every use.
See the controller-rs upgrade change for details.
await_condition by @olix0r in https://github.com/kube-rs/kube-rs/pull/877Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.72.0...0.73.0
The util::try_flatten_* helpers have been marked as deprecated since they are not used by the stream impls.
<!-- Release notes generated using configuration in .github/release.yml at 0.72.0 -->
A new runtime::WatchSteamExt (#899 + #906) allows for simpler setups for streams from watcher or reflector.
- let stream = utils::try_flatten_applied(StreamBackoff::new(watcher(api, lp), b));
+ let stream = watcher(api, lp).backoff(b).applied_objects();
The util::try_flatten_* helpers have been marked as deprecated since they are not used by the stream impls.
A new reflector:store() fn allows simpler reflector setups #907:
- let store = reflector::store::Writer::<Node>::default();
- let reader = store.as_reader();
+ let (reader, writer) = reflector::store();
Additional conveniences getters/settes to ResourceExt for manged_fields and creation_timestamp #888 + #898, plus a GroupVersion::with_kind path to a GVK, and a TryFrom<TypeMeta> for GroupVersionKind in #896.
Managing multiple version in CustomResourceDefinitions can be pretty complicated, but we now have helpers and docs on how to tackle it.
A new function kube::core::crd::merge_crds have been added (in #889) to help push crd schemas generated by kube-derived crds with different #[kube(version)] properties. See the kube-derive#version documentation for details.
A new example showcases how one can manage two or more versions of a crd and what the expected truncation outcomes are when moving between versions.
Examples now have moved to tracing for its logging, respects RUST_LOG, and namespace selection via the kubeconfig context. There is also a larger kubectl example showcasing kubectl apply -f yaml as well as kubectl {edit,delete,get,watch} via #885 + #897.
Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.71.0...0.72.0
<!-- Release notes generated using configuration in .github/release.yml at 0.71.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.71.0 -->
Several quality of life changes and improvements this release such as for port-forwarding, a new ClientBuilder, better handling of kube-derive edge-cases.
We highlight some changes here that you should be especially aware of:
kube-system for cluster scoped resourcesPublishing events via Recorder for cluster scoped resources (supported since 0.70.0) now publish to kube-system rather than default, as all but the newest clusters struggle with publishing events in the default namespace.
The previous native-tls default was there because we used to depend on reqwest, but because we depended on openssl anyway the feature does not make much sense. Changing to openssl-tls also improves the situation on macOS where the Security Framework struggles with PKCS#12 certs from OpenSSL v3. The native-tls feature will still be available in this release in case of issues, but the plan is to decommission it shortly. Of course, we all ideally want to move to rustls, but we are still blocked by #153.
ClientBuilder that lets users add custom middleware without full stack replacement by @teozkr in https://github.com/kube-rs/kube-rs/pull/855Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.70.0...0.71.0
<!-- Release notes generated using configuration in .github/release.yml at 0.70.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.70.0 -->
This was one of the big blockers for using rustls against clusters like k3d or k3s
While not sufficient to fix using those clusters out of the box, it is now possible to use them with a workarodund
The signature and end the Ok action in reconcile fns has been simplified slightly, and requires the following user updates:
-async fn reconcile(obj: Arc<MyObject>, ctx: Context<Data>) -> Result<ReconcilerAction, Error> {
- ...
- Ok(ReconcilerAction {
- requeue_after: Some(Duration::from_secs(300)),
- })
+async fn reconcile(obj: Arc<MyObject>, ctx: Context<Data>) -> Result<Action, Error> {
+ ...
+ Ok(Action::requeue(Duration::from_secs(300)))
The Action import lives in the same place as the old ReconcilerAction.
scheduler::Error by @teozkr in https://github.com/kube-rs/kube-rs/pull/827Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.69.0...0.70.0
This is an emergency patch release fixing a bug in 0.69.0 where a kube::Client would deadlock after running inside a cluster for about a minute (#829)
This is an emergency patch release fixing a bug in 0.69.0 where a kube::Client would deadlock after running inside a cluster for about a minute (#829).
All users of 0.69.0 are encouraged to upgrade immediately. 0.68.x and below are not affected.
<!-- Release notes generated using configuration in .github/release.yml at 0.69.1 -->
Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.69.0...0.69.1
Two new methods have been added to the client Api this release to reduce the amount of boiler-plate needed for common patterns.
Two new methods have been added to the client Api this release to reduce the amount of boiler-plate needed for common patterns.
Api::entry via 811 - to aid idempotent crud operation flows (following the style of Map::Entry)Api::get_opt via 809 - to aid dealing with the NotFound type error via a returned OptionFollowing a requirement for Kubernetes clients against versions >= 1.22.0, our bundled AuthLayer will reload tokens every minute when deployed in-cluster.
<!-- Release notes generated using configuration in .github/release.yml at 0.69.0 -->
ObjectRef<K> to ObjectReference by @teozkr in https://github.com/kube-rs/kube-rs/pull/815Api::get_opt for better existence handling by @teozkr in https://github.com/kube-rs/kube-rs/pull/809Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.68.0...0.69.0
To reduce the amount of allocation done inside the runtime by reflectors and controllers, the following change via #786 is needed on the signature of
To reduce the amount of allocation done inside the runtime by reflectors and controllers, the following change via #786 is needed on the signature of your reconcile functions:
-async fn reconcile(myobj: MyK, ctx: Context<Data>) -> Result<ReconcilerAction>
+async fn reconcile(myobj: Arc<MyK>, ctx: Context<Data>) -> Result<ReconcilerAction>
This also affects the finalizer helper.
As one of the last steps toward gold level client requirements, port-forwarding landed in #446. There are 3 new examples (port_forward*.rs) that showcases how to use this websocket based functionality.
<!-- Release notes generated using configuration in .github/release.yml at 0.68.0 -->
Arc by @olix0r in https://github.com/kube-rs/kube-rs/pull/786Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.67.0...0.68.0
<!-- Release notes generated using configuration in .github/release.yml at 0.67.0 -->
<!-- Release notes generated using configuration in .github/release.yml at 0.67.0 -->
DashMap with a locked AHashMap by @olix0r in https://github.com/kube-rs/kube-rs/pull/785Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.66.0...0.67.0
Tons of small feature additions, and 3 new contributors in this milestone. Highlighted first is the 3 most discussed changes:
Tons of small feature additions, and 3 new contributors in this milestone. Highlighted first is the 3 most discussed changes:
kube-deriveIt is now possible to embed complex enums inside structs that use #[derive(CustomResource)].
This has been a highly requested feature since the inception of auto-generated schemas. It does not work for all cases, and has certain ergonomics caveats, but represents a huge step forwards.
Note that if you depend on kube-derive directly rather than via kube then you must now add the schema feature to kube-core
StreamBackoff mechanism in kube-runtimeTo avoid spamming the apiserver when on certain watch errors cases, it's now possible to stream wrap the watcher to set backoffs. The new default_backoff follows existing client-go conventions of being kind to the apiserver.
Initially, this is default-enabled in Controller watches (configurable via Controller::trigger_backoff) and avoids spam errors when crds are not installed.
kube-coreTo aid users picking the most appropriate version of a kind from api discovery or through a CRD, two new sort orders have been exposed on the new kube_core::Version
Version::priority implementing kubernetes version priorityVersion::generation implementing a more traditional; generational sort (highest version)<!-- Release notes generated using configuration in .github/release.yml at 0.66.0 -->
DeleteParams constructors for easily setting PropagationPolicy by @kate-goldenring in https://github.com/kube-rs/kube-rs/pull/757identity_pem field from Config by @kazk in https://github.com/kube-rs/kube-rs/pull/771Full Changelog: https://github.com/kube-rs/kube-rs/compare/0.65.0...0.66.0
BREAKING: Removed kube::Error::OpenSslError - #716 by @kazk
kube::Error::OpenSslError - #716 by @kazkkube::Error::SslError - #704 and #716 by @kazkkube::Error::NativeTls(kube::client::NativeTlsError) for errors from Native TLS - #716 by @kazkkube::Error::RustlsTls(kube::client::RustlsTlsError) for errors from Rustls TLS - #704 by @kazkKubeconfig parsing - allow empty kubeconfigs as per kubectl - #721 by @kazkKubeconfig::from_yaml - #718 via #719 by @imprustls to 0.20.1 - #704 by @clux and @kazkObjectRef to the object that failed to be reconciled to kube::runtime::controller::Error::ReconcileFailed - #733 by @teozkrapi_version and kind fields from kind structs generated by kube::CustomResource - #739 by @teozkrtokio-tungstenite to 0.16 - #750 by @dependabottower-http to 0.2.0 - #748 by @kazkkube-client: replace RefreshTokenLayer with AsyncFilterLayer in AuthLayer - #752 by @kazkThe following breaking changes were made as a part of an effort to refine errors (the list is large, but most of them are lower level, and shouldn't r…
kube-derive/schema with attribute #[kube(schema)] - #690
kube-derive default features to avoid automatic schema generation, add #[kube(schema = "disabled")] to your spec struct insteadCustomResource derive crate overrides into subattribute #[kube(crates(...))] - #690
#[kube(kube_core = .., k8s_openapi = .., schema = .., serde = .., serde_json = ..)] with #[kube(crates(kube_core = .., k8s_openapi = .., schema = .., serde = .., serde_json = ..))]openssl-tls feature to use openssl for TLS on all platforms. Note that, even though native-tls uses a platform specific TLS, kube requires openssl on all platforms because native-tls only allows PKCS12 input to load certificates and private key at the moment, and creating PKCS12 requires openssl. - #700pem to 1.0.1. - #702oauth: Updated tame-oauth to 0.6.0 which supports the same default credentials flow as the Go oauth2 for Google OAuth. In addition to reading the service account information from JSON file specified with GOOGLE_APPLICATION_CREDENTIALS environment variable, Application Default Credentials from gcloud, and obtaining OAuth tokens from local metadata server when running inside GCP are now supported. - #701We started working on improving error ergonomics. See the tracking issue #688 for more details.
The following is the summary of changes to kube::Error included in this release:
Error::Auth(kube::client::AuthError) (errors related to client auth, some of them were previously in Error::Kubeconfig)Error::BuildRequest(kube::core::request::Error) (errors building request from kube::core)Error::InferConfig(kube::config::InferConfigError) (for Client::try_default)Error::OpensslTls(kube::client::OpensslTlsError) (new openssl-tls feature) - #700Error::UpgradeConnection(kube::client::UpgradeConnectinError) (ws feature, errors from upgrading a connection)Error::Connection (was unused)Error::RequestBuild (was unused)Error::RequestSend (was unused)Error::RequestParse (was unused)Error::InvalidUri (replaced by variants of errors in kube::config errors)Error::RequestValidation (replaced by a variant of Error::BuildRequest)Error::Kubeconfig (replaced by Error::InferConfig, and Error::Auth)Error::ProtocolSwitch (ws only, replaced by Error::UpgradeConnection)Error::MissingUpgradeWebSocketHeader (ws only, replaced by Error::UpgradeConnection)Error::MissingConnectionUpgradeHeader (ws only, replaced by Error::UpgradeConnection)Error::SecWebSocketAcceptKeyMismatch (ws only, replaced by Error::UpgradeConnection)Error::SecWebSocketProtocolMismatch (ws only, replaced by Error::UpgradeConnection)impl From<T> for Error<details> <summary>Expand for more details</summary>
The following breaking changes were made as a part of an effort to refine errors (the list is large, but most of them are lower level, and shouldn't require much change in most cases):
impl From<E> for kube::Error - #686kube::Error: Connection, RequestBuild, RequestSend, RequestParse - #689kube::error::ConfigError::LoadConfigFile - #689kube::Error::RequestValidation(String) to kube::Error::BuildRequest(kube::core::request::Error). Includes possible errors from building an HTTP request, and contains some errors from kube::core that was previously grouped under kube::Error::SerdeError and kube::Error::HttpError. kube::core::request::Error is described below. - #686kube::core::Error and kube::core::Result. kube::core::Error was replaced by more specific errors. - #686
kube::core::Error::InvalidGroupVersion with kube::core::gvk::ParseGroupVersionErrorkube::core::admission::AdmissionRequest::with_patch to kube::core::admission::SerializePatchError (was kube::core::Error::SerdeError)TryInto<AdmissionRequest<T>> to kube::core::admission::ConvertAdmissionReviewError (was kube::core::Error::RequestValidation)kube::core::Request to kube::core::request::Error (was kube::core::Error). kube::core::request::Error represents possible errors when building an HTTP request. The removed kube::core::Error had RequestValidation(String), SerdeError(serde_json::Error), and HttpError(http::Error) variants. They are now Validation(String), SerializeBody(serde_json::Error), and BuildRequest(http::Error) respectively in kube::core::request::Error.kube::runtime to tuples. Replaced snafu with thiserror. - #686kube::error::ConfigError and kube::Error::Kubeconfig(ConfigError) - #696
kube::client::AuthError as described belowkube::config::{InferConfigError, InClusterError, KubeconfigError} as described belowkube::client::AuthError by extracting error variants related to client auth from kube::ConfigError and adding more variants to preserve context - #696kube::error::OAuthError to kube::client::OAuthError - #696kube::client::auth to kube::client::AuthError - #696kube::Error::Auth(kube::client::AuthError) - #696kube::config::InferConfigError which is an error from Config::infer() and kube::Error::InferConfig(kube::config::InferConfigError) - #696kube::config::InClusterError for errors related to loading in-cluster configuration by splitting kube::ConfigError and adding more variants to preserve context. - #696kube::config::KubeconfigError for errors related to loading kubeconfig by splitting kube::ConfigError and adding more variants to preserve context. - #696kube::Config to return these erorrs instead of kube::Error - #696kube::Error::InvalidUri which was replaced by error variants preserving context, such as KubeconfigError::ParseProxyUrl - #696kube::Error::UpgradeConnection(kube::client::UpgradeConnectionError) - #696</details>
kube::events: fix build and hide module on kubernetes < 1.19 (events/v1 missing there) - #685
kube::runtime::events: fix build and hide module on kubernetes < 1.19 (events/v1 missing there) - #685fix docs.rs build - https://github.com/kube-rs/kube-rs/pull/682
kube::runtime::wait::Condition added boolean combinators (not/and/or) - #678rust edition bumped to 2021 - #664, #666, #667
kube now re-exports kube-runtime under runtime feature - #651 via #652
kube now re-exports kube-runtime under runtime feature - #651 via #652
kube and kube_runtime in Cargo.toml anymorekube_runtime::X import paths to kube::runtime::X when moving to the featurekube::runtime added events module with an event Recorder - #249 via #653 + #662 + #663kube::runtime::wait::conditions added is_crd_established helper - #659kube::CustomResource derive can now take an arbitrary #[kube_core] path for kube::core - #658kube::core consistently re-exported across cratesOne column per quarter.