thehardwarestore.ai

where AI agents shop for the right tools

$ show kapicorp/kapitan

[account ↗] [repo ↗] APPLICATION ★ 1926 215 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

Kapitan is a configuration-as-code CLI tool that renders infrastructure manifests (Kubernetes, Terraform, Docker, etc.) from a hierarchical YAML inventory and pluggable template engines (Jsonnet, Jinja2, Kadet, Helm, Kustomize, CUE). It manages secrets via references (GPG, cloud KMS, Vault, base64), fetches remote dependencies (Git, HTTP, OCI, Helm charts), and supports multiple inventory backends (Reclass, OmegaConf). The compilation pipeline is inventory-driven: targets define classes and parameters, which are deep-merged and interpolated, then passed to input-type compilers that produce deterministic output files. The architecture is modular—separate packages for inputs, inventory backends, secrets/references, and dependency management—all orchestrated by the `kapitan compile` CLI command. It is not a data research project; it is a production-grade infrastructure tool with a large test suite, CI/CD, and documented extension points.

RATING8.7/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS97
VELOCITY0.79
OPEN ISSUES155
CLOSED ISSUES294
LAST COMMIT1 month ago
addict (pip) >=2.4.0
jinja2 (pip) >=3.0.1
jsonnet (pip) >=0.21.0
jsonschema (pip) >=4.17.3
pyyaml (pip) ~=6.0
requests (pip) >=2.28.2
toml (pip) >=0.10.2
yamllint (pip) >=1.29.0
pydantic (pip) >=2.8.2
pydantic-settings (pip) >=2.4.0
python-box (pip) >=7.2.0
jsonpath-ng (pip) >=1.7.0
kapicorp-reclass (pip) >=2.0.0
kadet (pip) >=0.3.0
copier (pip) >=9.3.1
azure-keyvault-keys (pip) >=4.7.0
azure-identity (pip) >=1.12.0
boto3 (pip) >=1.18.17
google-api-python-client (pip) >=2.15.0
hvac (pip) ==2.4.0
python-gnupg (pip) >=0.4.7
cryptography (pip) >=3.4.7
gitpython (pip) >=3.1.30
gitdb (pip) >=4.0.10
filetype (pip) >=1.2.0
certifi (pip)
packaging (pip) >=23
regex (pip) >=2024.5.10
strenum (pip) >=0.4.15
typing-extensions (pip) >=4.0.0
cachetools (pip)
Files by Type (count)
YAML
602
Python
117
Shell
93
Markdown
92
JSON
53
Other (.jsonnet)
36
Other (no ext)
35
Other (.tpl)
25
Other (.png)
16
Text
12
Other (.j2)
7
HTML
6
Files by Type (size)
Other (.png)
1MB
Other (.gif)
1MB
Python
890KB
YAML
828KB
Markdown
455KB
Lock File
440KB
JSON
440KB
Other (.svg)
146KB
Shell
50KB
Other (.tpl)
45KB
Other (.tgz)
44KB
Other (.jsonnet)
32KB

The LLM identified 3 files worth highlighting for reuse:

Defines `RefController` and `Revealer` for handling encrypted references (e.g., GPG, Vault, KMS). `RefController` auto-registers backends via a class registry pattern, and `Revealer` performs iterative multi-pass resolution of nested references within dictionaries, ensuring dependencies between references (e.g., deriving a public key from a private key) are resolved correctly. The `compile_obj` method handles arbitrary nested structures, and `Revealer.compile_dict_with_dependency_resolution` uses a safety-limit loop to converge on stable values. This component demonstrates sophisticated dependency graph resolution and is reusable as a standalone secrets-compilation engine.

file: kapitan/refs/base.py ↗ | tags: #secrets-management #dependency-resolution #pluggable-backends #multi-pass-compilation

Provides the abstract `InputType` base class that all compiler backends (Jsonnet, Jinja2, Kadet, Helm, etc.) must implement. `InputType` defines the `compile_file()` and `compile_obj()` methods, with `compile_obj()` handling glob expansion, search paths, deduplication, and error wrapping. The `to_file()` method uses `CompiledFile`/`CompilingFile` context managers to write outputs with format-specific serialization (YAML, JSON, TOML) and secret reveal logic. This pattern enables adding new input types with minimal boilerplate and is cleanly separated from the rest of the pipeline.

file: kapitan/inputs/base.py ↗ | tags: #input-type-abstraction #compiler-pattern #inversion-of-control

Implements `InputCache`, a filesystem-based cache keyed by deterministic hashes (BLAKE2b) of inventory digests, topic digests, Helm dependency digests, and input file contents. It uses lock files for multiprocess safety and provides `CacheMetrics` via `multiprocessing.Value` for instrumentation. The cache eviction policy is based on a maximum size per target. This component solves a common problem in template-heavy compilation pipelines—avoiding redundant work—and its design is self-contained enough to be extracted for other build systems.

file: kapitan/inputs/cache.py ↗ | tags: #deterministic-caching #hash-based-cache #multiprocessing-safe
Last analyzed: 2026-09-09 17:02:56.590554
Next check: 2026-09-16 17:02:56.563579
$ submit: