talos-api-rs
A typed, async, idiomatic Rust client for the Talos Linux gRPC API.
Built for production use with connection pooling, circuit breakers, retry policies,
Prometheus metrics, and OpenTelemetry tracing. Inspired by kube-rs.
Features
- 40+ APIs — Machine, etcd, system, files, diagnostics
- Async-first — Built on
tokioandtonic - Strongly typed — No stringly-typed API calls
- Production-ready — Retries, circuit breakers, connection pooling
- Observable — Prometheus metrics, OpenTelemetry tracing
- mTLS support — ED25519 certificates (Talos default)
Non-Goals
- ❌ Not a replacement for
talosctl - ❌ No opinionated workflows (bootstrap orchestration, etc.)
- ❌ No CLI/UI layer
API Coverage
| Category | APIs | Status |
|---|---|---|
| Machine | Version, Hostname, Reboot, Shutdown, Upgrade, Rollback | ✅ |
| Configuration | ApplyConfiguration, GenerateConfiguration | ✅ |
| Cluster | Bootstrap, Kubeconfig, Reset | ✅ |
| Services | ServiceList, ServiceStart, ServiceStop, ServiceRestart | ✅ |
| etcd | MemberList, Status, AlarmList, Defragment, ForfeitLeadership | ✅ |
| System | Memory, CPUInfo, LoadAvg, DiskStats, Mounts, NetworkDeviceStats, Processes | ✅ |
| Files | List, Read, Copy, DiskUsage | ✅ |
| Diagnostics | Dmesg, Logs, Netstat, PacketCapture | ✅ |
See docs/todo.md for the full roadmap.
Installation
Add to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["full"] }
Quick Start
use ;
async
With mTLS (Production)
use ;
let config = TalosClientConfig ;
let client = new.await?;
Production Client with Resilience
use ;
use Duration;
// Configure with timeouts, retries, and circuit breaker
let config = builder
.ca_cert
.client_cert
.client_key
.connect_timeout
.request_timeout
.build;
let client = new.await?;
// Use high-level APIs
let hostname = client.hostname.await?;
let services = client.service_list.await?;
let kubeconfig = client.kubeconfig.await?;
Prometheus Metrics
use ;
let metrics = new;
// Record requests
metrics.record_request;
// Export Prometheus format
println!;
Documentation
- API Documentation — Full Rustdoc on docs.rs
- API Concept — Architecture and design decisions
- Architecture — Technical architecture
- API Stability — Stability guarantees
- Testing — Test strategy and harness
- Release Checklist — crates.io publication guide
- Release Preparations — Token and docs.rs setup
Contributing
Contributions are welcome! Please read CONTRIBUTING.md first.
# Clone and build
# Run tests
# Run integration tests (requires Docker and talosctl)
TALOS_DEV_TESTS=1
Disclaimer
This project is NOT affiliated with Sidero Labs or Talos Linux.
Provided AS-IS, without warranty of any kind. Use at your own risk.
Talos® is a registered trademark of Sidero Labs, Inc.
License
Licensed under either of:
- MIT License — LICENSE-MIT or https://opensource.org/license/mit/
- Apache License, Version 2.0 — LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0
at your option.
Contribution
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.