Skip to content

Kustomize Subcommand Integration #2386

Closed
@ghost

Description

Enhancement Description

  • One-line enhancement description (can be used as a release note): Kustomize Subcommand Integration
  • Kubernetes Enhancement Proposal:
[Kustomize](https://github.com/kubernetes-sigs/kustomize)
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


  • Discussion Link:
  • Primary contact (assignee): @Liujingfang1 @liggitt @seans3 @soltysh
  • Responsible SIGs: sig-cli
  • Enhancement target (which target equals to which milestone):
    • Alpha release target (x.y):
    • Beta release target (x.y):
    • Stable release target (x.y):
  • Alpha
    • KEP (k/enhancements) update PR(s):
    • Code (k/k) update PR(s):
    • Docs (k/website) update PR(s):

Please keep this description up to date. This will help the Enhancement Team to track the evolution of the enhancement efficiently.

Metadata

Metadata

Assignees

Labels

lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.sig/cliCategorizes an issue or PR as relevant to SIG CLI.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions