diff --git a/README.md b/README.md index 9d5cc8c15daffedb9b6145eb3cefcc235930dc62..fdc799f50a9582c4a8d9b3226f045ebda953672b 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,14 @@ jsonnet -J vendor -m manifests "${1-example.jsonnet}" | xargs -I{} sh -c 'cat {} This script runs the jsonnet code, then reads each key of the generated json and uses that as the file name, and writes the value of that key to that file, and converts each json manifest to yaml. +### Apply the manifests to setup Grafana and Prometheus +The previous steps (compilation) has created a bunch of manifest files in the manifest/ folder. +Now simply use kubectl to install Prometheus and Grafana as per your configuration: + +`kubectl apply -f manifests/` + +Check the monitoring namespace (or the namespace you have specific in `namespace: `) and make sure the pods are running. Prometheus and Grafana should be up and running soon. + ### Containerized Installing and Compiling If you don't care to have `jb` nor `jsonnet` nor `gojsontoyaml` installed, then build the `po-jsonnet` Docker image (this is something you'll need a copy of this repository for). Do the following from this `kube-prometheus` directory: @@ -212,6 +220,26 @@ docker run \ po-jsonnet ./build.sh example.jsonnet ``` +## Update from upstream project +You may wish to fetch changes made on this project so they are available to you. + +### Update jb +jb may have been updated so it's a good idea to get the latest version of this binary + +``` +go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb +``` + +### Update from Prometheus Operator +The command below will sync with upstream project. +``` +jb update +``` + +### Compile the manifests and apply +Once updated, just follow the instructions under "Compiling" and "Apply the manifests to setup Grafana and Prometheus" to apply the changes to your cluster. + + ## Configuration Jsonnet has the concept of hidden fields. These are fields, that are not going to be rendered in a result. This is used to configure the kube-prometheus components in jsonnet. In the example jsonnet code of the above [Usage section](#Usage), you can see an example of this, where the `namespace` is being configured to be `monitoring`. In order to not override the whole object, use the `+::` construct of jsonnet, to merge objects, this way you can override individual settings, but retain all other settings and defaults.