xtruder / kubenix

Replaced by https://github.com/hall/kubenix
MIT License
300 stars 34 forks source link

Loading custom resource definitions from yaml #19

Closed johnae closed 1 year ago

johnae commented 4 years ago

I see that there's support for loading resources from yaml files, however I've wanted to support using kustomize which basically generates a stream of yaml documents - this isn't supported by remarshal but is supported by yq via jq:s "-s" option so I've used that to enable loading of kustomizations.

Anyway, I've been toying around with switching completely from kustomize to kubenix but encountered some problems when trying to deploy cert-manager which defines its own types that I need to use from kubenix... it doesn't seem obvious to me how one would load such types from yaml such that they become available within kubenix.

Since there's very little docs atm I guess I might be missing something here but my question is if it is possible to load crd:s from yaml such that they become available as custom types within kubenix or if it is something you've thought about at all?

I really like what you're doing here, it's starting to look really awesome! Thanks for this!

johnae commented 4 years ago

I guess there's customTypes for this which could probably be used to dynamically define modules from yaml but defining the module doesn't seem to do much (seems to basically still be untyped), not sure why that happens.

offlinehacker commented 4 years ago

You basically need to define types using using customTypes, currently there is no support for directly loading types from crds. See example here: https://github.com/xtruder/kubenix/blob/master/tests/k8s/crd.nix#L28

offlinehacker commented 1 year ago

This repo has been deprecated, since I stopped maintaining it some time ago. There is a fork maintained by @hall available at https://github.com/hall/kubenix, that has better documentation and looks like a way further.