Templates Overview
Templates Overview
Templates are the heart of kTailor. They are stored as Kubernetes ConfigMaps with the label ktailor.dev/template: "true".
Scope: Central vs. Local
- Central: The webhook looks for the ConfigMap in its own namespace (usually
ktailor). These are globally managed. - Local: The webhook looks for the ConfigMap in the target Deployment’s namespace.
The 4 Phases Overview
kTailor applies modifications in four distinct phases:
- modifyContainers: Alters existing containers.
- addContainers: Injects new sidecar containers.
- addInitContainers: Injects initialization containers.
- addVolumes: Injects new Pod volumes.
Important Note: All elements within these phases (like environment variables, container definitions, volume mounts, and volumes) are written exactly as they are in a standard Kubernetes Deployment manifest. You do not need to learn a new syntax!