The kube-prometheus project provides a set of Kubernetes manifests, Grafana dashboards, and Prometheus rules to deploy a full monitoring stack for Kubernetes. It includes Prometheus, Alertmanager, and Grafana, along with various exporters and dashboards to monitor the health and performance of a Kubernetes cluster.
This project's design is to pull and manage the kube-prometheus YAML configurations using jsonnet from the upstream project. The Makefile provided in this project helps automate tasks such as initializing dependencies, generating manifests, cleaning up, and ensure required tools are present.
Before using the Makefile, ensure you have the following tools installed:
jb
(jsonnet Bundler)jsonnet
gojsontoyaml
The Makefile includes targets to help manage the project:
Runs the check-tools
, clean
, and manifests
targets in sequence. This is
the default target.
Initializes the jsonnet vendor packages by running jb init
and installs the
kube-prometheus jsonnet library.
Generates the kube-prometheus YAML files from the specified settings.jsonnet
file. It converts the jsonnet output to YAML and places the files in the base
directory. Removal of non-YAML files in the base
directory, and the
kustomization
file.
Removes the base
directory and its contents.
Updates the kube-prometheus jsonnet library to the latest version.
Checks if the installation of required tools (jb
, jsonnet
, and
gojsontoyaml
). If any of the tools are missing, the target will abort with an
error message.
Displays a help message with a brief description of each target.
To use the Makefile, run the following commands in your terminal:
-
Initialize the project:
make init
-
Generate the manifests:
make manifests
-
Clean up the generated files:
make clean
-
Upgrade the kube-prometheus library:
make upgrade
-
Check if required tools are installed:
make check-tools
-
Display the help message:
make help
By following these steps, you can manage the kube-prometheus YAML configurations efficiently using the provided Makefile.