You are viewing development documentation built from the latest commit on main (last tag v0.2.0-rc.2, source commit 25e1a892).
APIs and features are subject to change.
Patches
This directory demonstrates the TOML-style patch system from go-kure/launcher , using cert-manager resources as an example.
Files
cert-manager-simple.yaml- Base cert-manager resources (simplified)resources.kpatch- Resource limits using TOML container selectorsingress.kpatch- Service configuration with port selectorssecurity.kpatch- Security contexts with deployment targetingadvanced.kpatch- Complex selectors and variable substitution
TOML Patch Format
The patch files now use TOML-style headers for precise resource targeting:
Header Grammar
The TOML header format follows this grammar:
[kind.name[.section[.subsection[.selector]]]]Selector Types
- Key-value selectors:
containers.name=main - Index selectors:
ports.0,rules.1 - Bracketed selectors:
containers[image=nginx]
Kubernetes Path Mapping
The system intelligently maps TOML sections to Kubernetes paths:
| TOML Section | Kubernetes Path (Deployment) | Kubernetes Path (Service) |
|---|---|---|
containers | spec.template.spec.containers | spec.containers |
ports | spec.template.spec.containers.ports | spec.ports |
volumes | spec.template.spec.volumes | spec.volumes |
env | spec.template.spec.containers.env | N/A |
Variable Substitution
Support for dynamic values using variable substitution:
Variable context (a go-kure/launcher pkg/patch value, which kure does not compile):
Examples by Complexity
Basic Resource Targeting
Container-Specific Configuration
Service Configuration
Complex Array Manipulation
Key Features
- Intelligent Path Resolution - Automatic mapping based on resource kind
- Precise Targeting - Container-specific, port-specific, rule-specific patches
- Variable Substitution - Dynamic values with
${values.key}syntax - Complex Selectors - Multiple ways to target list items
- Backward Compatibility - Still supports legacy YAML format
- Context Awareness - Different behavior for different resource types
Migration from YAML
Old YAML format:
New TOML format:
Or with semantic selector:
The TOML format provides better readability, more precise targeting, and eliminates the need for long JSONPath expressions.