kuberneteskubebuilder

Is there a tool to generate customer resouce object from a Custom resource definition?


I have a complex kubernetes customer resource definition. I want to generate a valid custom resource object from the definition and then replace some values with mine. This is for quick testing purposes.

Instead of creating a yaml file from scratch, I'd like to use a tool to automatically generate it. Like what kubebuilder does when creating an API (put sample objects under config/samples).

Question: Is there any existing tool for this purpose?


Solution

  • Generally, for generating custom Kubernetes objects based on template there are two solutions:

    Both of them have a good documentations with examples - you can find them here for Kustomize and here for Helm.

    For better understanding what exactly are they used for and what are differences between them I suggest reading this article and this StackOverFlow answer.