Skip to content
Back to skills

Rust Cloud Native

ASecurity

Use when building cloud-native apps, microservices, or Kubernetes-deployed Rust services. Covers Docker, container builds, Dockerfile, multi-stage build, health endpoint, readiness and liveness probes, prometheus metrics, distributed tracing with OpenTelemetry and jaeger, graceful shutdown, 12-factor config, gRPC with tonic, and container optimization.

  • 57 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 17, 2026
devopsrustdockerkubernetes

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill rust-cloud-native --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rust Cloud Native?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rust Cloud Native
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-rust-cloud-native/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-rust-cloud-native)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rust-cloud-native
description: Use when building cloud-native apps, microservices, or Kubernetes-deployed Rust services. Covers Docker, container builds, Dockerfile, multi-stage build, health endpoint, readiness and liveness probes, prometheus metrics, distributed tracing with OpenTelemetry and jaeger, graceful shutdown, 12-factor config, gRPC with tonic, and container optimization.
---

# Cloud-Native Development

## Domain Constraints

| Domain Rule | Design Constraint | Rust Implication |
|-------------|-------------------|------------------|
| 12-Factor | Config from env | Environment-based config |
| Observability | Metrics + traces | tracing + opentelemetry |
| Health checks | Liveness/readiness | Dedicated endpoints |
| Graceful shutdown | Clean termination | Signal handling |
| Horizontal scale | Stateless design | No local state |
| Container-friendly | Small binaries | Release optimization |

## Critical Rules

- **No local persistent state** — pods can be killed/rescheduled anytime. Use external state (Redis, DB).
- **Handle SIGTERM, drain connections** — zero-downtime deployments require graceful shutdown.
- **Every request must be traceable** — distributed systems need tracing spans + opentelemetry export.

## Key Crates

| Purpose | Crate |
|---------|-------|
| gRPC | tonic |
| Kubernetes | kube, kube-runtime |
| Docker | bollard |
| Tracing | tracing, opentelemetry |
| Metrics | prometheus, metrics |
| Config | config, figment |

## Graceful Shutdown Pattern

```rust
use tokio::signal;

async fn run_server() -> anyhow::Result<()> {
    let app = Router::new()
        .route("/health", get(health))
        .route("/ready", get(ready));

    let addr = SocketAddr::from(([0, 0, 0, 0], 8080));

    axum::Server::bind(&addr)
        .serve(app.into_make_service())
        .with_graceful_shutdown(shutdown_signal())
        .await?;

    Ok(())
}

async fn shutdown_signal() {
    signal::ctrl_c().await.expect("failed to listen for ctrl+c");
    tracing::info!("shutdown signal received");
}
```

## Health Check Pattern

```rust
async fn health() -> StatusCode {
    StatusCode::OK
}

async fn ready(State(db): State<Arc<DbPool>>) -> StatusCode {
    match db.ping().await {
        Ok(_) => StatusCode::OK,
        Err(_) => StatusCode::SERVICE_UNAVAILABLE,
    }
}
```

## Common Mistakes

| Mistake | Domain Violation | Fix |
|---------|-----------------|-----|
| Local file state | Not stateless | External storage |
| No SIGTERM handling | Hard kills | Graceful shutdown |
| No tracing | Can't debug | tracing spans |
| Static config | Not 12-factor | Env vars |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.