nyl

Crates.ionyl
lib.rsnyl
version0.1.0
created_at2026-01-25 23:01:46.274068+00
updated_at2026-01-25 23:20:01.846038+00
descriptionKubernetes manifest generator with Helm integration
homepage
repositoryhttps://github.com/NiklasRosenstein/nyl
max_upload_size
id2069765
size658,332
Niklas Rosenstein (NiklasRosenstein)

documentation

README

Nyl

Kubernetes manifest generator with Helm integration - Rust edition

Release License: MIT

Fast, efficient Kubernetes manifest generation written in Rust. A complete rewrite of the Python version with 10x performance improvements and 70-90% memory reduction.

โœจ Features

  • ๐Ÿš€ Blazing Fast: 10x faster than Python version
  • ๐Ÿ’พ Memory Efficient: Uses <50MB RAM (vs ~200MB in Python)
  • ๐Ÿ“ฆ Single Binary: 8.5MB static binary with no dependencies
  • โšก Quick Start: <50ms cold start time
  • ๐ŸŽฏ Drop-in Replacement: Compatible with existing Python configurations
  • ๐Ÿ”ง Helm Integration: First-class Helm chart support with value customization
  • ๐ŸŒ Multi-Environment: Profile-based configurations (dev, staging, prod)
  • ๐Ÿ” Git Support: Private repository access with SSH/HTTPS authentication
  • ๐ŸŽจ Templating: Jinja2-compatible templates with custom filters
  • โ˜ธ๏ธ Kubernetes Native: kubectl-style diff and apply commands

๐Ÿ“ฅ Installation

From Release (Recommended)

# Download latest release for your platform
# Linux (x86_64)
curl -LO https://github.com/NiklasRosenstein/nyl/releases/latest/download/nyl-x86_64-unknown-linux-gnu.tar.gz
tar xzf nyl-x86_64-unknown-linux-gnu.tar.gz
sudo mv nyl /usr/local/bin/

# macOS (Apple Silicon)
curl -LO https://github.com/NiklasRosenstein/nyl/releases/latest/download/nyl-aarch64-apple-darwin.tar.gz
tar xzf nyl-aarch64-apple-darwin.tar.gz
sudo mv nyl /usr/local/bin/

# macOS (Intel)
curl -LO https://github.com/NiklasRosenstein/nyl/releases/latest/download/nyl-x86_64-apple-darwin.tar.gz
tar xzf nyl-x86_64-apple-darwin.tar.gz
sudo mv nyl /usr/local/bin/

From Source

# Clone repository
git clone https://github.com/NiklasRosenstein/nyl.git
cd nyl/nyl-rs

# Build and install
cargo install --path .

# Or just build
cargo build --release
# Binary will be at target/release/nyl

Using Cargo

cargo install --git https://github.com/NiklasRosenstein/nyl nyl

๐Ÿš€ Quick Start

# Create a new project
nyl new project my-app
cd my-app

# Validate configuration
nyl validate

# Render manifests for development
nyl render --environment dev

# See diff against cluster
nyl diff --environment dev

# Apply to cluster
nyl apply --environment dev

๐Ÿ“š Commands

Command Description
nyl new project <name> Create new project with scaffolding
nyl new component <api-version> <kind> Create component definition
nyl validate [--strict] Validate project configuration
nyl render [--environment ENV] Render manifests to stdout
nyl diff [--environment ENV] Show kubectl diff against cluster
nyl apply [--environment ENV] Apply manifests to cluster
nyl generate argocd Generate ArgoCD Applications
nyl cluster-info Display cluster version information

๐Ÿ“– Documentation

Comprehensive documentation is available in mdbook format:

# Serve documentation locally
cd nyl-rs && mdbook serve book --open

# Or view online
# https://niklasrosenstein.github.io/nyl/

Documentation includes:

  • Getting started guide
  • Configuration reference
  • Command documentation
  • Migration guide from Python
  • API reference (rustdoc)
  • Example projects

๐ŸŽฏ Examples

Check out the examples/ directory for practical usage:

  • simple-app - Basic web application with profiles
  • More examples coming soon!

๐Ÿ—๏ธ Architecture

src/
โ”œโ”€โ”€ cli/          # Command-line interface with clap
โ”‚   โ”œโ”€โ”€ commands/ # Command implementations (render, diff, apply, etc.)
โ”‚   โ””โ”€โ”€ output/   # Output formatting with colored diffs
โ”œโ”€โ”€ config/       # Project configuration loading
โ”œโ”€โ”€ template/     # MiniJinja templating engine
โ”œโ”€โ”€ generator/    # Manifest generation pipeline
โ”œโ”€โ”€ kubernetes/   # Kubernetes client integration (kube-rs)
โ”œโ”€โ”€ resources/    # HelmChart, Component resources
โ”œโ”€โ”€ git/          # Git repository management with authentication
โ”œโ”€โ”€ helm/         # Helm chart processing
โ”œโ”€โ”€ components/   # Component discovery and registry
โ”œโ”€โ”€ profiles/     # Profile management
โ”œโ”€โ”€ secrets/      # Secrets provider framework
โ””โ”€โ”€ util/         # Utilities (fs, hashing, etc.)

โš™๏ธ Development

Prerequisites

  • Rust 1.83 or newer
  • kubectl (for diff/apply commands)
  • Helm (for Helm chart rendering)

Building

# Development build
cargo build

# Release build (optimized)
cargo build --release

# Run tests
cargo test

# Run benchmarks
cargo bench

# Format and lint
cargo fmt
cargo clippy -- -D warnings

Using mise

The project includes a .mise.toml for tool management:

# Install tools
mise install

# Run tasks
mise run fmt          # Format code
mise run lint         # Run clippy
mise run test         # Run tests
mise run bench        # Run benchmarks
mise run docs-serve   # Serve documentation

๐Ÿ“Š Performance

Benchmarks

Metric Rust Python Improvement
Startup Time <50ms ~500ms 10x faster
Memory Usage <50MB ~200MB 75% reduction
100 Helm Charts <1s ~10s 10x faster
Binary Size 8.5MB ~100MB+ 92% smaller

Run benchmarks yourself:

cargo bench
# Results saved to target/criterion/

See BENCHMARKS.md for detailed performance analysis.

๐Ÿงช Testing

# Run all tests
cargo test

# Run with coverage
cargo tarpaulin --out Html

# Test specific module
cargo test --lib config::tests

# Integration tests
cargo test --test integration_test

Test Coverage:

  • 221 unit tests
  • 34 integration tests
  • 90%+ code coverage

๐Ÿ”„ Migration from Python

The Rust version is a drop-in replacement:

โœ… Existing nyl-project.yaml files work without modification โœ… Same CLI command structure โœ… Compatible YAML output โœ… Same Helm chart handling

See the Migration Guide for details.

๐Ÿ—บ๏ธ Roadmap

โœ… Completed (v0.1.0)

  • Configuration & CLI foundation
  • Template engine (Jinja2-compatible)
  • Helm integration
  • Component system
  • Git repository support with authentication
  • Kubernetes client integration
  • Diff & apply commands
  • ArgoCD integration

๐Ÿ”ฎ Future Releases

  • v0.2.0: SOPS secrets integration
  • v0.3.0: SSH tunnel & profile enhancements
  • v0.4.0: Advanced post-processing
  • v0.5.0: Performance optimizations & caching improvements

๐Ÿ“„ License

MIT License - see LICENSE for details

๐Ÿ™ Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

Contributors

๐Ÿ“ Changelog

See CHANGELOG.md for a detailed history of changes.

๐Ÿ”— Links


Made with โค๏ธ in Rust

Commit count: 329

cargo fmt