From 305c28681bbeeca6cc1f5df0e9771501cc0bc90a Mon Sep 17 00:00:00 2001 From: Vincent Brouillet <vincentbrouillet@nbnco.com.au> Date: Fri, 2 Nov 2018 13:52:38 +1100 Subject: [PATCH] adding an how to update section in kube-prometheus doc --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 9d5cc8c1..fdc799f5 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. -- GitLab