rust-service-lifecycle

Implement graceful startup and shutdown for Kubernetes-hosted Rust services.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/neon-law-foundation/navigator --skill rust-service-lifecycle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-service-lifecycle
Source: https://github.com/neon-law-foundation/navigator/tree/main/.claude/skills/rust-service-lifecycle
Command: npx skills add https://github.com/neon-law-foundation/navigator --skill rust-service-lifecycle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you wire long-running Rust binaries so they start reliably, report health correctly, and shut down cleanly during Kubernetes rollouts or interrupts.

Core Features & Use Cases

  • Ordered startup: Load config, initialize tracing, open dependencies, run migrations, and bind the server only after everything is ready.
  • Graceful shutdown: Handle SIGTERM and SIGINT with one canonical helper so in-flight requests can finish before termination.
  • Probe discipline: Distinguish liveness from readiness so pods drain safely instead of restarting unnecessarily.
  • Background-task control: Own spawned tasks, cancellation, and retry timing so long-running work stops predictably.
  • Use Case: A web service in Kubernetes needs /health and /readyz endpoints, clean drain behavior, and stable startup sequencing for database and external clients.

Quick Start

Ask me to apply the Rust service lifecycle pattern to a binary so it gains graceful shutdown, readiness probes, and dependency-safe startup.

Frequently Asked Questions about rust-service-lifecycle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle graceful shutdown for a Rust web service in Kubernetes?

Graceful shutdown for a Rust service in Kubernetes requires a canonical helper to handle SIGTERM and SIGINT, wiring with_graceful_shutdown so in-flight requests finish before the binary terminates safely during rollouts.

How do I implement readiness and liveness probes for a Rust service?

Implementing readiness and liveness probes for a Rust service involves distinguishing readiness from liveness so Kubernetes pods drain safely instead of restarting unnecessarily during dependency initialization or temporary unavailability.

What is the best way to sequence startup for Rust binaries with database dependencies?

Sequencing startup for Rust binaries requires ordered boot sequencing: load config, initialize tracing, open dependencies, run migrations, and bind the server only after everything is ready.

How do I manage background tasks during a Kubernetes rollout in Rust?

Managing background tasks during a Kubernetes rollout in Rust requires owning spawned tasks, controlling cancellation, and managing retry timing so long-running work stops predictably during manual interruption or deployment.

Why do my Rust pods restart unnecessarily during Kubernetes rollouts?

Rust pods restart unnecessarily during Kubernetes rollouts when readiness and liveness probes are not distinguished properly, causing the system to restart the pod instead of safely draining in-flight requests.

Do I need Kubernetes to use this Rust service lifecycle pattern?

You do not need Kubernetes exclusively, as the pattern implements graceful startup and shutdown for Rust service binaries handling SIGTERM and SIGINT, but it specifically targets Kubernetes-hosted web services needing coordinated draining during rollouts.