kube-prometheus: expand the minikube.jsonnet example

This commit is contained in:
Joshua Olson
2018-08-01 07:58:40 -05:00
parent cfa8ab7911
commit b3ab555603
2 changed files with 42 additions and 22 deletions

View File

@@ -5,6 +5,47 @@ local kp =
{
_config+:: {
namespace: 'monitoring',
alertmanager+:: {
config: importstr 'alertmanager-config.yaml',
},
grafana+:: {
config: {
sections: {
// Do not require grafana users to login/authenticate
"auth.anonymous": {enabled: true},
},
},
},
},
// For simplicity, each of the following values for 'externalUrl':
// * assume that `minikube ip` prints "192.168.99.100"
// * hard-code the NodePort for each app
prometheus+:: {
prometheus+: {
// Reference info: https://coreos.com/operators/prometheus/docs/latest/api.html#prometheusspec
spec+: {
// An e.g. of the purpose of this is so the "Source" links on http://<alert-manager>/#/alerts are valid.
externalUrl: "http://192.168.99.100:30900",
// Reference info: "external_labels" on https://prometheus.io/docs/prometheus/latest/configuration/configuration/
externalLabels: {
// This 'cluster' label will be included on every firing prometheus alert. (This is more useful
// when running multiple clusters in a shared environment (e.g. AWS) with other users.)
cluster: "minikube-<INSERT YOUR USERNAME HERE>",
},
},
},
},
alertmanager+:: {
alertmanager+: {
// Reference info: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#alertmanagerspec
spec+: {
externalUrl: "http://192.168.99.100:30903",
logLevel: "debug", // So firing alerts show up in log
},
},
},
};