rpi.carlosedp.cluster-monit.../metallb.jsonnet

59 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2019-08-08 22:09:53 +02:00
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
2019-02-04 21:01:11 +01:00
2019-02-27 13:28:00 +01:00
{
2019-02-04 21:01:11 +01:00
_config+:: {
namespace: 'monitoring',
prometheus+:: {
namespaces+:: ['metallb-system'],
},
2019-02-04 21:01:11 +01:00
},
metallbExporter+:: {
2019-02-04 21:01:11 +01:00
serviceMonitor:
{
apiVersion: 'monitoring.coreos.com/v1',
kind: 'ServiceMonitor',
metadata: {
name: 'metallb',
namespace: $._config.namespace,
labels: {
'k8s-app': 'metallb-controller',
},
},
spec: {
jobLabel: 'k8s-app',
selector: {
matchLabels: {
'k8s-app': 'metallb-controller',
},
},
endpoints: [
{
port: 'http',
scheme: 'http',
interval: '30s',
},
],
namespaceSelector: {
2019-03-13 22:44:01 +01:00
matchNames: [
'metallb-system',
],
},
2019-02-04 21:01:11 +01:00
},
},
service:
local service = k.core.v1.service;
local servicePort = k.core.v1.service.mixin.spec.portsType;
local metallbPort = servicePort.newNamed('http', 7472, 7472);
2019-03-13 22:44:01 +01:00
service.new('metallb-controller', { app: 'metallb', component: 'controller' }, metallbPort) +
2019-02-04 21:01:11 +01:00
service.mixin.metadata.withNamespace('metallb-system') +
service.mixin.metadata.withLabels({ 'k8s-app': 'metallb-controller' }) +
service.mixin.spec.withClusterIp('None'),
},
2019-03-13 22:44:01 +01:00
}