Skip to content

Commit 21579cf

Browse files
feat(standards): add Kubernetes standards page for kustomize and kubeconform
Add Kubernetes standards documentation covering Kustomize overlay validation and kubeconform schema validation. Update standards index with Kubernetes in per-language links. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6a493ea commit 21579cf

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

content/docs/standards/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Each Makefile target runs the relevant tools for all languages declared in `.dev
5252
- [Rust Standards](/docs/standards/rust/) -- clippy, rustfmt, cargo-audit, cargo-deny, cargo test
5353
- [Swift Standards](/docs/standards/swift/) -- SwiftLint, swift-format, swift test, xcodebuild
5454
- [Kotlin Standards](/docs/standards/kotlin/) -- ktlint, detekt, Gradle, Android Lint
55+
- [Kubernetes Standards](/docs/standards/kubernetes/) -- kustomize, kubeconform
5556
- [Universal Security](/docs/standards/universal/) -- trivy, gitleaks, git-cliff
5657

5758
## Consistent Page Structure
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: "Kubernetes"
3+
linkTitle: "Kubernetes"
4+
weight: 55
5+
description: "Kubernetes tooling standards: kustomize and kubeconform for manifest validation."
6+
---
7+
8+
Kubernetes projects use kustomize for rendering overlays and kubeconform for schema validation. Detection is automatic based on `kustomization.yaml` file presence -- no `.devrail.yml` language entry is needed.
9+
10+
## Tools
11+
12+
| Category | Tool | Purpose |
13+
|---|---|---|
14+
| Manifest Validation | kustomize build | Render overlays, catch structural errors |
15+
| Schema Validation | kubeconform | Validate against Kubernetes API schemas |
16+
17+
All tools are pre-installed in the dev-toolchain container. Do not install them on the host.
18+
19+
## Configuration
20+
21+
### kustomize
22+
23+
No config file required. Reads `kustomization.yaml` in each overlay directory.
24+
25+
### kubeconform
26+
27+
No config file required. Validates against built-in Kubernetes schemas. Override the target version if needed:
28+
29+
```bash
30+
kustomize build overlays/production | kubeconform -strict -kubernetes-version 1.29.0
31+
```
32+
33+
For CRDs, add additional schema sources:
34+
35+
```bash
36+
kubeconform -strict \
37+
-schema-location default \
38+
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'
39+
```
40+
41+
## Makefile Targets
42+
43+
| Target | Command | Description |
44+
|---|---|---|
45+
| `make lint` | `kustomize build <dir> \| kubeconform -strict -summary` | Validate each Kustomize overlay |
46+
47+
Detection is automatic. Every directory containing `kustomization.yaml` is validated independently.
48+
49+
## Pre-Commit Hooks
50+
51+
### CI-Only (too slow for local hooks)
52+
53+
Kustomize validation runs via `make lint` in CI. It is not configured as a local pre-commit hook because `kustomize build` may need to fetch remote bases.
54+
55+
## Notes
56+
57+
- **Kustomize is a companion tool, not a language.** No `.devrail.yml` entry needed. Auto-detected by `kustomization.yaml` presence.
58+
- **kubeconform replaces kubeval.** kubeval is deprecated. kubeconform is the maintained successor with better CRD support.
59+
- **Each overlay is validated independently.** The Makefile finds all `kustomization.yaml` files and validates each directory.
60+
- **CRD validation requires schema sources.** Core Kubernetes resources are validated by default. CRDs need additional schema locations configured.
61+
- **All tools are pre-installed in the dev-toolchain container.** Do not install them on the host.
62+
- For cross-cutting coding practices and git workflow standards, see [Coding Practices](/docs/standards/practices/).

0 commit comments

Comments
 (0)