Adding the following accross the project:
```bash
/# exit immediately when a command fails
set -e
/# only exit with zero if all commands of the pipeline exit successfully
set -o pipefail
/# error on unset variables
+set -u
```
The current example-app setup in the kube-prometheus project is able to
discover scraping targets in the default namespace. It is not able to
discover the configured Alertmanager in the monitoring namespace.
This patch adds an alertmanager-discovery rbac role, to permit the
above described action. In addition it does the following cleanups:
- Remove kubeconfig configuration in deploy and teardown script. kubectl
chooses .kube/config whenever KUBECONFIG is not set by default
- Remove namespace specification option via NAMESPACE env var. In most
of the manifests the metadata/namespace was hardcoded anyways, in
addition in the promtheus frontend role binding the service account
namespace is hardcoded to default as well.
- Instead of `kubectl {apply,delete}` individual manifests, the deploy
and teardown shell scripts {apply,delete} on the entire folder.
In some cases we have been using `alert-rules` in some cases
`prometheus-rulefiles`. This led to confusion [1]. Instead, unify the
Prometheus rules configmap labels to:
```yaml
labels:
role: alert-rules
```
[1] https://github.com/coreos/prometheus-operator/issues/1102
added service account, role and role binding for the prometheus frontend
example, also updated prometheus to use the correct service account
fixes#1049
Bump prometheus to 2.0.0, prometheus-operator to 0.15.0, alertmanager to 0.12.0 and node-exporter to 0.15.1, grafana to 4.6.3
migrate prometheus alerts to yaml notation
In the generated version of this file at /contrib/kube-prometheus/manifests/grafana/grafana-deployment.yaml the version was bumped to 4.5.2 but seems it was overlooked in this templated version of the file.