Hacker News new | ask | show | jobs
by jnpatel 3557 days ago
An alternative is to use Jsonnet [0] (a JSON/YAML templating language).

You can define an inheritance relationship, where your template inherits pretty much everything EXCEPT the environment variables. Or the jsonnet cli lets you specify variables to be replaced in the template.

There's some kubernetes flavored examples in [1].

[0] http://jsonnet.org/

[1] https://github.com/google/jsonnet/tree/master/case_studies/k...

2 comments

The Stackanetes project[0] has been using KPM and Jsonette in order to template out a fully configurable OpenStack cluster running on Kubernetes. It's a pretty awesome achievement. The project is pretty far along and I've even seen them demo live migration of VMs across Kubernetes workers.

[0]: https://github.com/stackanetes/stackanetes

We've been using Jsonnet. It's saved much boilerplate and makes the syntax more concise. In our case we are taking advantage of the +: operator to provide a compositional DSL.

Container(foo, image) + HealthCheck(port) + EnvVar(VAR,value) + UseVolume(foo, /var/lib)

Sounds neat! Have you open-sourced this?