diff --git a/README.md b/README.md index bc320b7922796890dfd17d9f4b1ab09bfbed2e5d..115fbbbfcddc4083ad02facc452d21c6a4c009b7 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,7 @@ local kp = { ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } + { ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } + { ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } + ``` And here's the [build.sh](build.sh) script (which uses `vendor/` to render all manifests in a json structure of `{filename: manifest-content}`): diff --git a/docs/developing-prometheus-rules-and-grafana-dashboards.md b/docs/developing-prometheus-rules-and-grafana-dashboards.md index 671a898706d77b46f57be05788ee3b3c9167ec38..17838b829b44200af1d555523934eeba44260b05 100644 --- a/docs/developing-prometheus-rules-and-grafana-dashboards.md +++ b/docs/developing-prometheus-rules-and-grafana-dashboards.md @@ -25,6 +25,7 @@ local kp = { ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } + { ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } + { ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } + ``` ## Prometheus rules diff --git a/examples/kustomize.jsonnet b/examples/kustomize.jsonnet index e1cf7a2713b6f5f530a3c60a0521481c7ba6606e..1b6b903865e34044e0beeca678b236e6231670af 100644 --- a/examples/kustomize.jsonnet +++ b/examples/kustomize.jsonnet @@ -15,14 +15,14 @@ local manifests = { ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } + { ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) }; -local kustomizationResourceFile(name) = "./manifests/" + name + ".yaml"; +local kustomizationResourceFile(name) = './manifests/' + name + '.yaml'; local kustomization = { apiVersion: 'kustomize.config.k8s.io/v1beta1', kind: 'Kustomization', - resources: std.map(kustomizationResourceFile, std.objectFields(manifests)) + resources: std.map(kustomizationResourceFile, std.objectFields(manifests)), }; manifests { - "../kustomization": kustomization, + '../kustomization': kustomization, }