- https://github.com/google/jsonnet or https://github.com/google/go-jsonnet
- https://github.com/jsonnet-bundler/jsonnet-bundler
-
jb init
to create an empty jsonnetfile.json -
jb install github.com/prometheus-operator/prometheus-operator@v0.52.1
-
Create
main.jsonnet
with following content just to evaulate the jsonnet mixin from prometheus-operator(import 'github.com/prometheus-operator/prometheus-operator/jsonnet/mixin/alerts.jsonnet')
-
Run
jsonnet -J vendor main.jsonnet
to generate json file-J vendor
is specified for jsonnet to search library in this location since we had pulled library usingjb
-
To generate yaml from this json use
gojsontoyaml
utilityjsonnet -J vendor main.jsonnet|gojsontoyaml`