Nyl
Kubernetes manifest generator with Helm integration - Rust edition
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)
# macOS (Apple Silicon)
# macOS (Intel)
From Source
# Clone repository
# Build and install
# Or just build
# Binary will be at target/release/nyl
Using Cargo
๐ Quick Start
# Create a new project
# Validate configuration
# Render manifests for development
# See diff against cluster
# Apply to cluster
๐ 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
# 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
# Release build (optimized)
# Run tests
# Run benchmarks
# Format and lint
Using mise
The project includes a .mise.toml for tool management:
# Install tools
# Run tasks
๐ 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:
# Results saved to target/criterion/
See BENCHMARKS.md for detailed performance analysis.
๐งช Testing
# Run all tests
# Run with coverage
# Test specific module
# Integration tests
Test Coverage:
- 221 unit tests
- 34 integration tests
- 90%+ code coverage
๐ Migration from Python
The Rust version keeps the same core workflow, with one important project-config change:
- Project settings are loaded from
nyl.toml([project]section). - Legacy
nyl-project.*files must be migrated.
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
- Niklas Rosenstein (@NiklasRosenstein)
๐ Changelog
See CHANGELOG.md for a detailed history of changes.
๐ Links
Made with โค๏ธ in Rust