← Back to all products
$29
Kubernetes Manifests
Kubernetes manifest library with deployments, services, ingress, and RBAC configurations.
JSONMarkdownPythonKubernetes
📄 Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample📁 File Structure 9 files
kubernetes-manifests/
├── LICENSE
├── README.md
├── examples/
│ └── app_spec.json
├── free-sample.zip
├── guide/
│ ├── 01_features.md
│ ├── 02_configuration-reference.md
│ └── 03_generated-files.md
├── index.html
└── src/
└── k8s_generator.py
📖 Documentation Preview README excerpt
Kubernetes Manifests
Part of the Deploy Kit by CodeVault
Generate production-ready Kubernetes deployment manifests from a simple JSON application spec. Creates Deployments, Services, Ingress, ConfigMaps, and HorizontalPodAutoscalers — all with security best practices baked in.
Features
- Generate complete K8s manifests: Deployment, Service, Ingress, ConfigMap, HPA
- Security-hardened defaults: non-root containers, read-only filesystem, resource limits
- Readiness and liveness probe configuration
- Horizontal Pod Autoscaler with CPU/memory targets
- Namespace-aware resource generation
- Multi-environment support (dev, staging, production) with different replica counts
- Ingress with TLS configuration
- ConfigMap and Secret references
- Validates your app spec before generating
- Python stdlib only — zero dependencies
Quick Start
# Generate all K8s manifests from the example spec
python src/k8s_generator.py --config examples/app_spec.json
# Write to a target directory
python src/k8s_generator.py --config examples/app_spec.json --output-dir ./k8s/
# Generate only specific resources
python src/k8s_generator.py --config examples/app_spec.json --resources deployment,service
# Generate for a specific environment
python src/k8s_generator.py --config examples/app_spec.json --env production
# Validate config without generating
python src/k8s_generator.py --config examples/app_spec.json --validate-only
Configuration Reference
| Field | Type | Required | Description |
|---|---|---|---|
app_name | string | Yes | Application name (used in all resource names) |
namespace | string | No | K8s namespace (default: default) |
image | string | Yes | Container image (e.g., ghcr.io/acme/app:latest) |
replicas | int | No | Replica count (default: 2) |
port | int | Yes | Container port |
service_port | int | No | Service port (default: same as port) |
env_vars | object | No | Environment variables as key-value pairs |
resources | object | No | CPU/memory requests and limits |
health_check | object | No | Liveness/readiness probe config |
ingress | object | No | Ingress host, path, and TLS config |
hpa | object | No | Autoscaler min/max replicas and CPU target |
environments | object | No | Per-environment overrides |
labels | object | No | Additional labels for all resources |
CLI Reference
| Flag | Description |
|---|
... continues with setup instructions, usage examples, and more.
📄 Code Sample .py preview
src/k8s_generator.py
#!/usr/bin/env python3
"""
Kubernetes Manifest Generator — Deploy Kit by DataNest
Generate production-ready Kubernetes deployment manifests from a JSON
application specification. Creates Deployments, Services, Ingress rules,
ConfigMaps, and HorizontalPodAutoscalers with security best practices.
Why this exists:
Writing Kubernetes YAML by hand is painful — deep nesting, easy-to-miss
fields, and security settings you always forget (runAsNonRoot, resource
limits, readOnly filesystem). This tool generates correct, security-
hardened manifests from a simple app spec so you can deploy confidently.
Usage:
python k8s_generator.py --config app.json
python k8s_generator.py --config app.json --output-dir ./k8s/
python k8s_generator.py --config app.json --resources deployment,service
python k8s_generator.py --config app.json --env production
License: MIT
"""
from __future__ import annotations
import argparse
import json
import logging
import sys
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
# ---------------------------------------------------------------------------
# Constants
# ---------------------------------------------------------------------------
VALID_RESOURCES = {"namespace", "deployment", "service", "ingress", "configmap", "hpa"}
LOG = logging.getLogger("k8s-generator")
# ---------------------------------------------------------------------------
# Data Models
# ---------------------------------------------------------------------------
@dataclass
class ResourceSpec:
"""CPU/memory resource requests and limits."""
requests: dict[str, str] = field(default_factory=lambda: {"cpu": "250m", "memory": "256Mi"})
# ... 542 more lines ...