Skip to content

kube-derive: yaml vs. rust question #554

Answered by clux
webern asked this question in Q&A
Jun 11, 2021 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Is the correct workflow to maintain a CRD spec both as a YAML file and as a Rust struct with the CustomResource derive? Or can the YAML be generated from the Rust struct (or the Rust struct from the YAML)?

You can generate the yaml from the rust struct (not the other way around), and you should commit that generated file, because the definition is usually applied out of band (crd write perms are usually cluster admin type permissions, and you generally don't want your controller to have it).

I recommend a small bin entry point to generate this file like crdgen in controller-rs.

Or can the CRD be applied to the cluster by a Rust program that skips the YAML formatting altogether?

You ca…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@webern
Comment options

@webern
Comment options

@clux
Comment options

Answer selected by webern
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussions possibly more of a discussion piece than an issue
3 participants
Converted from issue

This discussion was converted from issue #553 on June 11, 2021 19:52.