Skip to content

Upgrading#

You can upgrade kube using normal Rust methods to upgrade, as long as you stick to semver compatible versions of k8s-openapi and schemars (if using custom resource derive).

Peer dependencies

kube depends on a handful of unstable crates at certain versions, but new versions of these crates have not always propagated into kube.
To avoid build issues, k8s-openapi and schemars must NOT exist at multiple semver incompatible versions in your dependency tree.

We recommend you bump kube, k8s-openapi and schemars crates at the same time to avoid build issues.

Consider bumping the kubernetes-version feature pin on k8s-openapi unless you are using its latest feature.

Command Line#

Using cargo upgrade via cargo-edit:

cargo upgrade -p kube -p k8s-openapi -p schemars -i

Schemars 1

The major version of schemars 1 is expected to be released in the next Kubernetes version (1.34) in kube 2.0. Until then, if you need schemars 1, pinning to git is an option. Schemars 1 will not work with kube 1.

Dependabot#

Configure the cargo ecosystem on dependabot and group codependent crates:

  - package-ecosystem: "cargo"
    directory: "/"
    schedule:
      interval: "weekly"
    groups:
      kube:
        patterns:
          - kube
          - k8s-openapi
          - schemars

Renovate#

Add package rules for Kubernetes crates that match on prefixes:

packageRules: [
        {
            matchPackagePrefixes: [
                "kube",
                "k8s",
                "schemars",
            ],
            groupName: "kubernetes crates",
            matchManagers: [
                "cargo"
            ],
        }
]