Note: the work on this repository is now based on CoreOS's kube-prometheus and it will be the default option for Kubernetes 1.7.X and up. For 1.5.X and 1.6.X you can deploy a simpler solution, located in ./basic
directory.
The purpose of this project is to provide a simple and interactive method to deploy and configure Prometheus on Kubernetes, especially for the users that are not using Helm.
StatefulSets
for persistent storagekubectl
configuredIf you are running Kubernetes 1.12 or higher you will also need to run cAdvisor on your cluster (bound to host port 4194) in order to access resource usage and performance characteristics of running containers.
Clone the repository and checkout the latest release: curl -L https://git.io/getPrometheusKubernetes | sh -
All the components versions can be configured using the interactive deployment script. Same for the SMTP account or the Slack token.
Some other settings that can be changed before deployment:
manifests/prometheus/prometheus-k8s.yaml
manifests/prometheus/prometheus-k8s.yaml
manifests/prometheus/prometheus-k8s.yaml
manifests/alertmanager/alertmanager.yaml
assets/alertmanager/alertmanager.yaml
assets/grafana/
with names ending in -dashboard.json
assets/prometheus/rules/
Note: please commit your changes before deployment if you wish to keep them. The deploy
script will remove the changes on most of the files.
./deploy
Now you can access the dashboards locally using kubectl port-forward
command, or expose the services using a ingress or a LoadBalancer. Please check the ./tools
directory to quickly configure a ingress or proxy the services to localhost.
To remove everything, just execute the ./teardown
script.
assets/prometheus/rules/
and execute scripts/generate-rules-configmap.sh
. Then apply the changes using kubectl apply -f manifests/prometheus/prometheus-k8s-rules.yaml -n monitoring
assets/grafana/
and execute scripts/generate-dashboards-configmap.sh
. Then apply the changes using kubectl apply -f manifests/grafana/grafana-dashboards.cm.yaml
.Note: all the Grafana dashboards should have names ending in -dashboard.json
.
The official documentation for Prometheus Operator custom configuration can be found here: custom-configuration.md
If you wish, you can update the Prometheus configuration using the ./tools/custom-configuration/update_config
script.