Skip to content

k8s crd to pkl generation #100

Answered by holzensp
Pythoner6 asked this question in Q&A
Feb 8, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

You can generate the CRDs thanks to @jackkleeman's awesome work.

Docs here: https://pkl-lang.org/package-docs/pkg.pkl-lang.org/pkl-pantry/k8s.contrib.crd/current/generate/index.html

The simplest usage is:

pkl eval package://pkg.pkl-lang.org/pkl-pantry/k8s.contrib.crd@1.0.0#/generate.pkl \
  -m . \
  -p source="https://path/to/crd.yml"

This will generate Pkl files in the current directory for the provided CRD specs.

You can fine-tune this by creating your own generate script that amends the published generator. For example, this causes the generator to use module ResourceRequirements for the spec.resources property of your CRD:

generate.pkl

amends "package://pkg.pkl-lang.org/pkl-pantry/k8s…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@Pythoner6
Comment options

@jackkleeman
Comment options

Answer selected by Pythoner6
Comment options

You must be logged in to vote
1 reply
@Pythoner6
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants