Merge pull request #2252 from jouve/grafana

add service monitor for grafana
This commit is contained in:
Frederic Branczyk
2019-01-08 22:05:46 +01:00
committed by GitHub
4 changed files with 40 additions and 1 deletions

View File

@@ -15,7 +15,32 @@ local configMapList = k.core.v1.configMapList;
namespace: k.core.v1.namespace.new($._config.namespace),
},
grafana+:: {
local serviceLabels = {
app: 'grafana',
},
dashboardDefinitions: configMapList.new(super.dashboardDefinitions),
service+: {
labels+: serviceLabels,
},
serviceMonitor: {
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata: {
name: 'grafana',
namespace: $._config.namespace,
},
spec: {
selector: {
matchLabels: serviceLabels,
},
endpoints: [
{
port: 'http',
interval: '15s',
},
],
},
},
},
} + {
_config+:: {

View File

@@ -8,7 +8,7 @@
"subdir": "contrib/kube-prometheus/jsonnet/kube-prometheus"
}
},
"version": "8582fcce481d4302a9c29e9b5e4182c5d98d67ed"
"version": "d3b2645d2ace03b36ed7d86e5213c09c9e1bde67"
},
{
"name": "ksonnet",

View File

@@ -1,5 +1,7 @@
apiVersion: v1
kind: Service
labels:
app: grafana
metadata:
name: grafana
namespace: monitoring

View File

@@ -0,0 +1,12 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: grafana
namespace: monitoring
spec:
endpoints:
- interval: 15s
port: http
selector:
matchLabels:
app: grafana