3 ms·
An alternative is to use Jsonnet [0] (a JSON/YAML templating language). You can define an inheritance relationship, where your template inherits pretty much ev
by jnpatel 10y 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/ http://jsonnet.org/
[1] https://github.com/google/jsonnet/tree/master/case_studies/kubernetes https://github.com/google/jsonnet/tree/master/case_studies/k...
- meta_AU 10y agoWe'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)
- jnpatel 10y agoSounds neat! Have you open-sourced this?
- jzelinskie 10y agoThe 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 https://github.com/stackanetes/stackanetes