- Home
- Skills
- Zhanghandong
- Rust Skills
- Domain Cloud Native
domain-cloud-native_skill
- Shell
565
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill zhanghandong/rust-skills --skill domain-cloud-native- SKILL.md4.0 KB
Overview
This skill captures cloud-native domain constraints and concrete Rust design implications for building containerized microservices. It focuses on stateless design, graceful shutdown, observability, health checks, and 12-factor configuration. Use it to align architecture and implementation choices when targeting Kubernetes, service meshes, and container platforms.
How this skill works
The skill translates high-level domain rules into actionable design constraints and Rust patterns. It maps requirements (tracing, shutdown, health, config, scaling) to crates (tonic, kube, tracing, opentelemetry, prometheus) and code patterns (signal handling, dedicated health endpoints, env-based config). It highlights common mistakes and prescribes fixes to keep services cloud-native.
When to use it
- Designing microservices intended to run in Kubernetes or other orchestrators
- Implementing gRPC services, service mesh integrations, or operators in Rust
- Adding observability: tracing, metrics, and distributed context propagation
- Hardening services for production: health checks and graceful shutdown
- Converting a stateful app into a horizontally scalable, stateless service
Best practices
- Follow 12-factor: read config from env and secrets, avoid static config files
- Keep services stateless; use external stores (DB, Redis) for persistence
- Implement graceful shutdown using tokio::signal and connection draining
- Instrument requests with tracing spans and export via OpenTelemetry
- Expose /health and /ready endpoints; make readiness depend on critical deps
- Optimize binaries for containers and minimize image size
Example use cases
- A tonic-based gRPC microservice with tracing and Prometheus metrics for a service mesh
- A Kubernetes operator using kube-runtime Controller to manage custom resources
- An HTTP API built with axum exposing /health and /ready and handling SIGTERM for zero-downtime deploys
- A Rust worker connecting to external Redis and DB, keeping no local persistent state
- Adding OpenTelemetry spans and exporters to trace requests across microservices
FAQ
Avoid relying on local persistent files. Use ephemeral in-memory caches only for performance and ensure they can be rebuilt; persist important state to external services.
What crates should I use for observability?
Use tracing for structured spans, opentelemetry for exporters, and prometheus or metrics for metrics collection and scraping.