← Back to all products

Kubernetes Manifests

$29

Kubernetes manifest library with deployments, services, ingress, and RBAC configurations.

12 files
PythonMarkdownJSONKubernetes

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 12 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 ├── interactive.html ├── src/ │ └── k8s_generator.py └── tests/ └── test_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

FieldTypeRequiredDescription
app_namestringYesApplication name (used in all resource names)
namespacestringNoK8s namespace (default: default)
imagestringYesContainer image (e.g., ghcr.io/acme/app:latest)
replicasintNoReplica count (default: 2)
portintYesContainer port
service_portintNoService port (default: same as port)
env_varsobjectNoEnvironment variables as key-value pairs
resourcesobjectNoCPU/memory requests and limits
health_checkobjectNoLiveness/readiness probe config
ingressobjectNoIngress host, path, and TLS config
hpaobjectNoAutoscaler min/max replicas and CPU target
environmentsobjectNoPer-environment overrides
labelsobjectNoAdditional labels for all resources

CLI Reference

FlagDescription

... 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 ...