kubenix icon indicating copy to clipboard operation
kubenix copied to clipboard

Loading custom resource definitions from yaml

Open johnae opened this issue 4 years ago • 2 comments

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 avatar Apr 11 '20 08:04 johnae

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.

johnae avatar Apr 13 '20 13:04 johnae

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 avatar Apr 14 '20 03:04 offlinehacker

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.

offlinehacker avatar Feb 11 '23 15:02 offlinehacker