---
name: "kustomize-overlay-patching"
description: "Customize raw Kubernetes manifests across staging and production environments without templating."
metadata:
  author: "Kubernetes SIGs"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write kustomize overlay patch"
  - "use kustomize configmapgenerator"
  - "run kustomize build"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Kustomize Overlay Patching & Secret Generators

Builds Kubernetes configurations with Kustomize: base and overlays directory structures, strategic merge patches, JSON 6902 patches, configMapGenerator, secretGenerator, and images tag overrides.

## When to Invoke
Invoke this skill whenever you need to:
- write kustomize overlay patch
- use kustomize configmapgenerator
- run kustomize build

## Execution SOP & Rules
1. Organize directories into base/ (kustomization.yaml + resources) and overlays/prod/.
2. In overlays/prod/kustomization.yaml, reference resources: ['../../base'] and declare patches.
3. Use images: override list to update image tags in CI without editing raw deployment files.
4. Verify rendered manifests: kustomize build overlays/prod | kubectl apply --dry-run=client -f -.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
