Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: kube-rs/kube

3.1.0

17 Mar 11:12
3.1.0
a3a111c

Choose a tag to compare

What's Changed

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.

Added

Fixed

New Contributors

Full Changelog: 3.0.1...3.1.0

3.0.1

30 Jan 14:14
3.0.1
28e63b6

Choose a tag to compare

What's Changed

Bugfix release for schemas, admission, and docs. Minor internal improvements listed in the milestone. Important fixes below.

Fixed

New Contributors

Full Changelog: 3.0.0...3.0.1

3.0.0

12 Jan 09:09
3.0.0
8ed4a1d

Choose a tag to compare

New Major

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.

Breaking Changes

Kubernetes v1_35 support via k8s-openapi 0.27

Please upgrade k8s-openapi along with kube to avoid conflicts.

jiff replaces chrono

Matching 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: #1868 + #1870

ErrorResponse has been replaced with Status

ErrorResponse 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),
     })?;

#1875 + #1883 + #1891.

Predicates now has a TTL Cache

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 #1836. This helped expose and fix a bug in watches with streaming_lists now fixed in #1882.

Subresource Api

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; #1884

Improvements

Support Kubernetes 1.30 Aggregated Discovery

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; #1876 + #1873 + #1889

New Client RetryPolicy opt-in

Allows 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*.

Rust 2024

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 #1856 + #1792

Fixes

  • streaming list bug fix - #1882
  • watcher jitter bug fix - #1897
  • schema fix for IntOrString - #1867
  • schema fix for optional enums - #1853
  • websocket keepalives for long running attaches - #1889

More

  • Resize subresource impl for Pod - #1851
  • add #[kube(attr="...") to allow custom attrs on derives - #1850
  • example updates for admission w/axum - #1859

What's Changed

Added

  • Add Resize subresource for Pod by @hugoponthieu in #1851
  • feat: add #[kube(attr="...")] attribute helper to set attribute helper on the CR root type by @ngergs in #1850
  • Rust 2024 let-chains to simplify wait Conditions by @clux in #1792
  • Adds a try_clone method for kube_client::client::Body when it's Kind::Once by @meowjesty in #1867
  • Implement client aggregated discovery API methods by @doxxx93 in #1873
  • Implement aggregated discovery API methods by @doxxx93 in #1876
  • Permit older version of API for v2 discovery for k8s < 1.30 (down to 1.27) by @Danil-Grigorev in #1889
  • Add RetryPolicy for client-level request retries by @doxxx93 in #1894

Changed

Fixed

  • fix: add use<> to kubelet_node_logs for rust edition 2024 by @co42 in #1849
  • Transform optional enums to match pre kube 2.0.0 format by @Danil-Grigorev in #1853
  • Distinguish between initial and resumed watch phases for streaming lists by @doxxx93 in #1882
  • Re-export deprecated type alias and improve deprecation guidance by @clux in #1883
  • Add nullable to optional fields with x-kubernetes-int-or-string by @doxxx93 in #1885
  • send websocket ping to keep idle connections alive by @inqode-l...
Read more

2.0.1

12 Sep 19:36
2.0.1
45f9c9b

Choose a tag to compare

What's Changed

Fixes an accidental inclusion of a constraint added to Api::log_stream introduced in the 2.0.0 Rust 2024 upgrade.

Fixed

New Contributors

Full Changelog: 2.0.0...2.0.1

2.0.0

08 Sep 07:48
2.0.0

Choose a tag to compare

Kubernetes v1_34 support via k8s-openapi 0.26

Please upgrade k8s-openapi along with kube to avoid conflicts.

Schemars 1.0

A fairly significant upgrade in #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.

New Minimums

Minimum versions: MSRV 1.85.0 (for edition 2024), MK8SV: 1.30 (unchanged).

Highlights

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

New Major

A new semver major for unstable, public facing dependency updates. As per the new release cycle, it is aligned with the Kubernetes release.

What's Changed

Added

Changed

Fixed

  • Clamp scheduling delay to 6 months by @dervoeti in #1779
  • Update admission example and pin to a local crd by @clux in #1782
  • Fix interactive auth mode to allow prompt messages by @gememma in #1800
  • Make kube::runtime::controller::Action ctors const by @imp in #1804
  • Fix oidc with openssl by @saif-88 in #1807

New Contributors

Full Changelog: 1.1.0...2.0.0

1.1.0

26 May 18:57
1.1.0
1ba4b2a

Choose a tag to compare

What's Changed

Missing attribute bugfix + extra standard derives on core::conversion structs.

Added

Fixed

Full Changelog: 1.0.0...1.1.0

1.0.0

13 May 09:36
1.0.0
ed3d390

Choose a tag to compare

A Major Version

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 #1688 for more information.

Kubernetes v1_33 support via k8s-openapi 0.25

Please upgrade k8s-openapi along with kube to avoid conflicts.

New minimum versions: MSRV 1.82.0, MK8SV: 1.30*

KubeSchema

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 #1750, handle #[validate] attributes #1749, and pass validation rules as string literals #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.

What's Changed

Added

Changed

Removed

  • Remove deprecated watcher::Event into_iter_* methods by @clux in #1738

Fixed

New Contributors

Full Changelog: 0.99.0...1.0.0

0.99.0

12 Mar 16:07
0.99.0
c9b7b70

Choose a tag to compare

Highlights

Dependency Cleanups

Features

What's Changed

Added

Changed

  • Replace backoff with backon by @flavio in #1653
  • Bump rand to 0.9 by @clux in #1686
  • Remove rand dependency in favor of tungstenite fn by @clux in #1691
  • Exec can return stdout data even after stdin is closed. by @esw-amzn in #1693
  • Bump json-patch to 4 use bundled jsonptr to 0.7 by @clux in #1718
  • Allow removing hyper-rustls/ring feature by @eliad-wiz in #1717

Fixed

  • kube-runtime: fix exponential backoff max times by @eliad-wiz in #1713
  • CustomResource derive; allow status attribute to take a path by @clux in #1704

New Contributors

Full Changelog: 0.98.0...0.99.0

0.98.0

23 Dec 12:56
0.98.0
3f122f9

Choose a tag to compare

Highlights

What's Changed

Added

  • Add storage and served argument to derive macro by @Techassi in #1644
  • Implement derive(CELSchema) macro for generating cel validation on CRDs by @Danil-Grigorev in #1649

Changed

  • Add series implementation for runtime event recorder by @pando85 in #1655
  • Bump k8s-openapi for Kubernetes v1_32 support and MSRV by @clux in #1671
  • Update tokio-tungstenite requirement from 0.24.0 to 0.25.0 by @dependabot in #1666

Fixed

  • Add support for UTF-16 encoded kubeconfig files by @goenning in #1654

New Contributors

Full Changelog: 0.97.0...0.98.0

0.97.0

20 Nov 12:17
0.97.0
69d7995

Choose a tag to compare

Highlights

  • CustomResource derive added features for crd yaml output:
  • Configuration edge cases:
    • Avoid double installations of aws-lc-rs (rustls crypto) provider #1617
    • Kubeconfig fix for null user; #1608
    • Default runtime watcher backoff alignment with client-go #1603
  • Feature use:
    • Client proxy feature-set misuse prevention #1626
    • Allow disabling gzip via Config #1627
  • Depedency minors: thiserror, hashbrown, jsonptr, json-patch. Killed lazy_static / once_cell

What's Changed

Added

Changed

Fixed

New Contributors

Full Changelog: 0.96.0...0.97.0