One-line enhancement description (can be used as a release note): Kustomize Subcommand Integration
Kubernetes Enhancement Proposal:
was developed as a subproject of sig-cli by kubectl maintainers to address
a collection of [issues](#motivation)) creating friction for declarative workflows in kubectl
(e.g. `kubectl apply`). The
goal of the kustomize subproject was to bring this functionality back to kubectl to better complement
`kubectl apply` and other declarative workflow commands.
- declaratively generating Resource config
- declaratively transforming Resource config
- composing collections of Resource config across files and directories
- layering the above on top of one another
It is independent of, but complementary to, the [*server-side apply*](https://github.com/kubernetes/enhancements/issues/555)
initiative that was started later and targeted at a separate collection of
`kubectl apply` issues.
Kustomize offers generators and transformations in a declarative form that
improve on functionality provided by existing imperative commands in kubectl.
The declarative approach offers a clear path to accountability (all input can
be kept in version control), can safely exploit a holistic, unbounded view of
disparate resources and their interdependence (it's a plan about what to do,
not a direct action), and can be easily constrained to verifiable rules
across this view (all edits must be structured, no removal semantics, no
environment side-effects, etc.).
Imperative kubectl commands / flags available through kustomize:
- `kubectl create configmap`
- `kubectl create secret`
- `kubectl annotate`
- `kubectl label`
- `kubectl patch`
- `-n` (namespace)
- `-f <filename>` (kubectl processes files with lists of Resources)
Kubectl commands / flags similar to what is available through kustomize:
- `-f <dir> -R` (kubectl - recursing through directories, kustomize may follow references)
- `kubectl set image` (kustomize directive to set the image tag only, not the image)
Things in kustomize that are not imperative kubectl commands / flags:
- `namePrefix` (prepend all resource names with this)
- `nameSuffix` (append all resource names with this)
- for a limited set of fields allow one field value to be set to match another
This was needed for KEP migration, but the mechanism is already completed and GA.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.