Initially aimed at minikube, but should be adaptable for real clusters.
- Adds node_exporter DaemonSet to each node
- Creates a persistant volume and claim for prometheus data
- Creates a prometheus instance
- Creates an alertmanager instance.
- Creates a pushgateway instance.
- Creates a statsd exporter instance.
- Creates a blackbox exporter instance.
- Prometheus will monitor all elements of the kube cluster (including services)
- A grafana deployment (no state is kept yet, and no default data source setup)
- A templated grafana dashboard (not loaded by default yet)
-
go to prometheus-k8s directory
-
on one terminal, run
tiller
-
copy down tiller listening port number
-
open another terminal, run
helm install . --host 0.0.0.0:<tiller port number>
e.g.
helm install . --host 0.0.0.0:44134
-
after deployed, run
charts/grafana/create-datasource.sh
-
on terminal, run
minikube dashboard minikube service prometheus minikube service grafana
-
go to browser, and find the internal ip address of prometheus
-
assign grafana instance to prometheus internal ip address with 9090 port (e.g. 172.17.0.8:9090)
- For service, NodePort should change to LoadBalancer.
- It will use 'port' instead of 'NodePort'.
Please see the config on federate-configmap.yaml.sample. Pay special attention on job_name: 'federate' settings.
- 'match[]' config must be '{name=~".+"}'
- Should skip tls verify.
- Kill prometheus pod to get config work immediately (curl -XPOST http://:9090/-/reload not work properly)
Currently I include a docker registry in k8s for ease of testing / development. Have tried mounting into some persist volume but failed. Mounting into the host VM would be far faster.
Extra steps:
-
Add "--insecure-registry=:5000" into DOCKER_OPTS
-
Start minikube with "--insecure-registry :5000".
minikube start --insecure-registry 192.168.99.100:5000
In general, minikube ip should be fixed on 192.168.99.100. If you use the registry inside minikube, please bear in mind to update your deployment yaml file before and after your experiments.
You need to put something like this in your service:
```
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '4001'
...
spec:
...
```
- How to specify the volumes?
- Prometheus rules in a config map
- Reload prometheus config on rule update
- HA Prom (should just mean changing the rep count)
- HA Alertmanager
- Alertmanager config
These configs are released under the Apache 2.0 license. All images downloaded are subject to their individual licenses.