add service monitor to grafana
This commit is contained in:
@@ -15,7 +15,32 @@ local configMapList = k.core.v1.configMapList;
|
|||||||
namespace: k.core.v1.namespace.new($._config.namespace),
|
namespace: k.core.v1.namespace.new($._config.namespace),
|
||||||
},
|
},
|
||||||
grafana+:: {
|
grafana+:: {
|
||||||
|
local serviceLabels = {
|
||||||
|
app: 'grafana',
|
||||||
|
},
|
||||||
dashboardDefinitions: configMapList.new(super.dashboardDefinitions),
|
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+:: {
|
_config+:: {
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
labels:
|
||||||
|
app: grafana
|
||||||
metadata:
|
metadata:
|
||||||
name: grafana
|
name: grafana
|
||||||
namespace: monitoring
|
namespace: monitoring
|
||||||
|
12
manifests/grafana-serviceMonitor.yaml
Normal file
12
manifests/grafana-serviceMonitor.yaml
Normal 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
|
Reference in New Issue
Block a user