kubebuilder icon indicating copy to clipboard operation
kubebuilder copied to clipboard

Kustomize support for config/samples

Open joelanford opened this issue 4 years ago • 8 comments

What do you want to happen? When I run kubebuilder create api, a sample CR gets created in config/samples. I'm wondering if there is any appetite for config/samples to be a valid kustomize directory, such that one could run kustomize build config/samples to get kubectl-appliable yaml.

If we were to add such a feature, I think we would add a scaffold that supports updates via a marker such that kubebuilder create api would append the new sample file to the resources list in config/samples/kustomization.yaml.

Use cases:

  • After running make deploy, I want to be able to quickly spin up a sample set of CRs using kustomize build config/samples | kubectl apply -f -
  • I want to be able to utilize all of the benefits of kustomize with the samples, e.g. to set a namePrefix, commonLabels, overlays, etc.
  • I want to include samples in other kustomize scenarios. E.g.:
    • Generating Operator Lifecycle Manager (OLM) manifests where the combination of config/default and config/samples is useful.
    • Executing schema validation of samples by building CRDs and samples and verifying CRDs exist for each sample and that each sample validates against the CRD schema. This would combine config/crd and config/samples.

Is there currently another issue associated with this? Not that I could find.

Does it require a particular kubernetes version? No

/kind feature

joelanford avatar Jun 23 '20 16:06 joelanford

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Sep 21 '20 17:09 fejta-bot

/remove-lifecycle stale

camilamacedo86 avatar Sep 21 '20 17:09 camilamacedo86

Just a note: #1831 approach may be also considered

Adirio avatar Dec 01 '20 18:12 Adirio

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

fejta-bot avatar Mar 01 '21 19:03 fejta-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten

fejta-bot avatar Mar 31 '21 20:03 fejta-bot

/lifecycle frozen

Since this has label triage/accepted

joelanford avatar Apr 22 '21 17:04 joelanford

It should be done in the kustomize/v2-alpha plugin.

camilamacedo86 avatar Jul 01 '22 10:07 camilamacedo86

@estroz I unassigned this one since we have no longer with and others might able to help with this one.

camilamacedo86 avatar Jul 01 '22 10:07 camilamacedo86

/assign

Kavinjsir avatar Nov 17 '22 19:11 Kavinjsir