Skip to content

kform-dev/pydantic-crd-model-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This repo contains an example how to use pydantic models as crds.

There are 2 crd model examples in the apis directory

config as v1alpha1 node as v1alpha1

The structure in this project is similar how kubebuilder is setup. Store the apis in the apis directory, structure them per group and each api version is stored in its respective version directory (in this example v1alpha1)

For each crd aka pydantic model a _types.py files is created For each version we create a exporter.py file in which you indicate the script_dir and the models you want to export

Overall there is a makefile that first exports a json schema for each model and after the generator script picks up these exported schemas and generates a crd for each model in the crds directory.

prerequisites to use this repo

install the following python package in a virtual environment

choreopy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published