Upgrading#
You can upgrade kube using normal Rust methods to upgrade, as long as you stick to semver compatible versions of k8s-openapi and other dependencies interacting with kube.
The most common dependencies to upgrade alongside are;
- schemars (if using custom resource derive)
- envtest (if using go style integration tests)
- kopium (if generating crds in rust code from external crds)
We recommend you upgrade these together. Example setups below.
Single Dependency Versions
These crates rely on on trait implementations and compile time features that often fail to compile when multiple versions are present. To avoid build issues, k8s-openapi, kube, and schemars should NOT exist at multiple semver incompatible versions in your dependency tree. Use cargo tree -p kube -i to locate duplicates. Sometimes your lockfile will hold outdated pins.
It is possible to pin the kubernetes-version on k8s-openapi with a feature (although using the latest feature is recommended, since it allows automated upgrades).
Example Setups#
Command Line#
Using cargo upgrade via cargo-edit:
cargo upgrade -p kube -p k8s-openapi -p schemars -p envtest -i
Dependabot#
Configure the cargo ecosystem on dependabot and group codependent crates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
groups:
kube:
patterns:
- kube
- k8s-openapi
- envtest
- kopium
- schemars
Renovate#
Add package rules for Kubernetes crates that match on prefixes:
packageRules: [
{
matchPackagePrefixes: [
"kube",
"k8s",
"kopium",
"envtest",
"schemars",
],
groupName: "kubernetes crates",
matchManagers: [
"cargo"
],
}
]