mirror of
https://github.com/carlosedp/cluster-monitoring.git
synced 2024-11-20 19:07:17 +01:00
Merge pull request #85 from Nashluffy/master
This commit is contained in:
commit
0ad298d1b9
1464
grafana-dashboards/nginx-dashboard.json
Normal file
1464
grafana-dashboards/nginx-dashboard.json
Normal file
File diff suppressed because it is too large
Load Diff
44
modules/nginx.jsonnet
Normal file
44
modules/nginx.jsonnet
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
local utils = import '../utils.libsonnet';
|
||||||
|
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
|
||||||
|
|
||||||
|
{
|
||||||
|
_config+:: {
|
||||||
|
namespace: 'monitoring',
|
||||||
|
grafanaDashboards+:: {
|
||||||
|
'nginx-dashboard.json': (import '../grafana-dashboards/nginx-dashboard.json'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
nginxExporter+:: {
|
||||||
|
serviceMonitor:
|
||||||
|
utils.newServiceMonitor('nginx', $._config.namespace, { 'app.kubernetes.io/name': 'ingress-nginx' }, 'ingress-nginx', 'prometheus', 'http'),
|
||||||
|
|
||||||
|
service:
|
||||||
|
local service = k.core.v1.service;
|
||||||
|
local servicePort = k.core.v1.service.mixin.spec.portsType;
|
||||||
|
local nginxPort = servicePort.newNamed('prometheus', 10254, 10254);
|
||||||
|
|
||||||
|
service.new('ingress-nginx-metrics', {'app.kubernetes.io/name': 'ingress-nginx'}, nginxPort) +
|
||||||
|
service.mixin.metadata.withNamespace('ingress-nginx') +
|
||||||
|
service.mixin.metadata.withLabels({'app.kubernetes.io/name': 'ingress-nginx'}) +
|
||||||
|
service.mixin.spec.withClusterIp('None'),
|
||||||
|
|
||||||
|
clusterRole:
|
||||||
|
utils.newClusterRole('nginx-exporter', [
|
||||||
|
{
|
||||||
|
apis: [''],
|
||||||
|
res: ['services', 'endpoints', 'pods'],
|
||||||
|
verbs: ['get', 'list', 'watch'],
|
||||||
|
},
|
||||||
|
], null),
|
||||||
|
|
||||||
|
|
||||||
|
serviceAccount:
|
||||||
|
utils.newServiceAccount('nginx-exporter', $._config.namespace, null),
|
||||||
|
|
||||||
|
|
||||||
|
clusterRoleBinding:
|
||||||
|
utils.newClusterRoleBinding('nginx-exporter', 'nginx-exporter', $._config.namespace, 'nginx-exporter', null),
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
@ -25,6 +25,11 @@
|
|||||||
enabled: false,
|
enabled: false,
|
||||||
file: import 'modules/metallb.jsonnet',
|
file: import 'modules/metallb.jsonnet',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'nginxExporter',
|
||||||
|
enabled: false,
|
||||||
|
file: import 'modules/nginx.jsonnet',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'traefikExporter',
|
name: 'traefikExporter',
|
||||||
enabled: false,
|
enabled: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user