| Crates.io | talos-rust-client |
| lib.rs | talos-rust-client |
| version | 0.1.3 |
| created_at | 2025-08-24 13:44:24.549934+00 |
| updated_at | 2025-08-24 13:44:24.549934+00 |
| description | Rust gRPC client for SideroLabs Talos (mTLS, tonic, rustls) |
| homepage | https://github.com/nuditech/talos-rust-client |
| repository | https://github.com/nuditech/talos-rust-client |
| max_upload_size | |
| id | 1808363 |
| size | 420,478 |
Rust gRPC client for SideroLabs Talos with mTLS support.
Add this to your Cargo.toml:
[dependencies]
talos-rust-client = "0.1"
To use talosconfig file support:
[dependencies]
talos-rust-client = { version = "0.1", features = ["talosconfig"] }
use talos_rust_client::{TalosConnector, machine::MachineServiceClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Read certificates
let ca = std::fs::read("ca.crt")?;
let cert = std::fs::read("client.crt")?;
let key = std::fs::read("client.key")?;
// Connect to Talos
let channel = TalosConnector::new("https://192.168.1.100:50000")
.ca_pem(ca)
.cert_pem(cert)
.key_pem(key)
.connect()
.await?;
// Create a client
let mut client = MachineServiceClient::new(channel);
// Get version
let request = tonic::Request::new(talos_rust_client::common::EmptyRequest {});
let response = client.version(request).await?;
Ok(())
}
use talos_rust_client::talosconfig::TalosConfig;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load from default location (~/.talos/config)
let config = TalosConfig::from_file("~/.talos/config")?;
// Connect using current context
let channel = config.connector()?.connect().await?;
// Use the channel with any service client...
Ok(())
}
See the examples directory for more detailed examples:
version.rs - Get Talos version informationhealth.rs - Check cluster healthevents.rs - Stream Talos eventstalosconfig_connect.rs - Connect using talosconfigRun examples with:
# Using environment variables for certs
export TALOS_ENDPOINT="https://192.168.1.100:50000"
export TALOS_CA="ca.crt"
export TALOS_CERT="client.crt"
export TALOS_KEY="client.key"
cargo run --example version
# Using talosconfig
cargo run --example talosconfig_connect --features talosconfig
This crate includes Talos API definitions as a git submodule pinned to a specific release tag. The current version is pinned to v1.10.6.
To update the submodule to a different tag, see CONTRIBUTING.md.
This crate enforces mTLS (mutual TLS) for all connections. There is no option to disable TLS or certificate verification. Always ensure your certificates and keys are kept secure and never logged or exposed.
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.