Skip to content
Snippets Groups Projects
Commit 3ec88e52 authored by Cyril Jouve's avatar Cyril Jouve
Browse files

add service monitor to grafana

parent f7bb04a7
No related branches found
No related tags found
No related merge requests found
......@@ -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+:: {
......
apiVersion: v1
kind: Service
labels:
app: grafana
metadata:
name: grafana
namespace: monitoring
......
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: grafana
namespace: monitoring
spec:
endpoints:
- interval: 15s
port: http
selector:
matchLabels:
app: grafana
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment