| Crates.io | istio-api-rs |
| lib.rs | istio-api-rs |
| version | 0.12.0 |
| created_at | 2022-08-26 09:19:14.08266+00 |
| updated_at | 2025-10-19 09:15:35.200207+00 |
| description | A collection of CRDs for api used in Istio. |
| homepage | https://github.com/BlankZhu/istio-api-rs |
| repository | https://github.com/BlankZhu/istio-api-rs |
| max_upload_size | |
| id | 652675 |
| size | 7,255,559 |
A collection of CRDs used in Istio, generated by kopium directly from istio CRDs.
istio-api-rs is built on top of kube-rs as a set of CRDs, which means it can be easily used under kube_rs like below:
use istio_api_rs::networking::v1beta1::{
destination_rule::*,
gateway::*,
virtual_service::*,
};
use kube::{
api::ListParams,
Api, Client,
};
use rustls::crypto::CryptoProvider;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
CryptoProvider::install_default(rustls::crypto::ring::default_provider()).expect("failed to install default crypto provider");
let client = Client::try_default().await?;
let list_opt = ListParams::default();
let gws: Api<Gateway> = Api::namespaced(client.clone(), "default");
for gw in gws.list(&list_opt).await? {
println!("Found Gateway: {}", gw.metadata.name.unwrap());
}
let drs: Api<DestinationRule> = Api::namespaced(client.clone(), "default");
for dr in drs.list(&list_opt).await? {
println!("Found Destination Rule: {}", dr.metadata.name.unwrap());
}
let vss: Api<VirtualService> = Api::namespaced(client.clone(), "default");
for vs in vss.list(&list_opt).await? {
let content = serde_yaml::to_string(&vs).unwrap();
println!("Found Virtual Service with YAML content: {}", content);
}
Ok(())
}
And in cargo.toml, you should specify the API version for both k8s & istio like:
[dependencies]
# ...
tokio = { version = "^1", features = ["full"] }
hyper-util = "0.1.17"
tower = "0.5.2"
rustls = "0.23.32"
anyhow = "^1"
serde_yaml = "0.9"
tracing-subscriber = "^0.3"
kube = { version = "2.0.1", features = ["runtime", "derive"] }
k8s-openapi = { version = "0.26.0", features = ["v1_31", "schemars"] }
schemars = { version = "^1.0" }
istio-api-rs = { version = "0.12.0", features = ["v1_23"] }
# ...
istio-api-rs is currently developed and tested on istio/api since v1.10, the lower api version is out of this repository's concern.
The repository is using istio-api-rs-codegen as code generator, go check that repository if you want to know more about how the codes are generated.
For release package, see crates.io.