splunk / qbec

configure kubernetes objects on multiple clusters using jsonnet
https://qbec.io
Apache License 2.0
172 stars 37 forks source link

Packaging applications #58

Open kvaps opened 5 years ago

kvaps commented 5 years ago

Hi, I have few cool projects and I want to share them with the community. I want to use qbec to provide set of end components of my application.

The problem is that I don't know how to package my application to provide it for end users without depriving of flexibility. I want to allow them to use the same components set and override their default parameters. At the same time, I want to provide the ability to easily update my components.

At the moment, the best implementation I've seen is how working hugo and hugo themes. Eg each hugo theme is repeats the hierarchy of the main site but in own folder. So you can easily add theme using git submoudule and immediately start using it

I want something like this but for qbec. Eg. User runs:

qbec init app
cd app
git init
git submodule add https://github.com/kvaps/some-qbec-application pkg/some-qbec-application

And now he can see all the components provided by package:

qbec show default

After this he can add new own components by usual way just placing them into components of his project. So this way he don't need to modify parent repository. And he have simplicity of upgrade and for override default parameters.

What do you thinking about this? Maybe is there more elegant way?

gotwarlost commented 5 years ago

qbec really wasn't built for packaging libraries for use by others so this use-case needs additional thought to design and implement. What you propose is a good first start but I can see it become really problematic when multiple such libraries are involved etc.

Gut feeling says that there should be some level of support to bundle qbec apps as a jsonnet bundle that can be consumed by a user via jb. There are some problems with this approach:

kvaps commented 5 years ago

By the way, I've decided that symlinks can solve partially this problem:

Eg user can do:

git submodule add https://github.com/kvaps/some-qbec-application pkg/some-qbec-application
(cd components/; ln -s ../pkg/some-qbec-application/components/* .)

To link all the components from the parent repository.

Otherwise there is an opportunity to use helm for packing an applications. Repository with helm chart can be connected same way using git submodule, and rendered via std.native('expandHelmTemplate') funtion.