[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Bootstrap template



Hello,

I am using an openshift origin cluster and defined a few dozen objects grouped in several yaml files. Now I would like to "package" them into a single template such that everything can be bootstrapped from scratch in as few steps as possible from the GUI catalog, but I also want to avoid having to maintain manually a separate template with all the objects I already defined.

My current solution is to use `oc export --as-template` to wrap all my objects into a single template, and then I still have to massage the result a bit: since some of my original objects are templates themselves, if I just create a new application from the generated template the "nested templates" will be created effectively as templates, and I would need more steps and clicks through the GUI to deploy those.

So I wrote a `flatten` script that, given the template generated by `oc export`, promotes all nested templates one level up (if an object is a template, take its parameters and objects, and append them to the top-level template's, the nested template is then dropped).

So in order to create a "bootstrapping" template in the project, I could do something like:

oc export --as-template=bootstrap -f objects/ | flatten.py | oc annotate -f - ... | oc create -f -

I could also pipe the output of `flatten.py` to `oc process` in order to create all the objects directly (assuming that I'm also specifying the templates' parameters).

This works well for my specific case, but it doesn't really seem right. So:
- How is this kind of situation usually managed?
- Does openshift itself provide a way (or guidelines on how) to manage objects/configurations? otherwise what are some usual solutions to this issue? (note: the question is about whole platforms hosted on openshift, with a few dozens of interacting services) - Would a "flatten" feature be a useful companion to `oc export --as-template`? Or why wouldn't it be? - Alternatively, is there a way to reference other templates from a template, such that the GUI catalog allows to display, configure and deploy a set of templates at once? (the presentation factor is kind of important in my project)

Thanks,
Jeremiah


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]