* INFRA-2333 | Ashvin | Format jsonnet * INFRA-2333 | Ashvin | Add busybox image for local sandbox * INFRA-2333 | Ashvin | Disable startup probe for local sandbox
67 lines
1.9 KiB
Jsonnet
67 lines
1.9 KiB
Jsonnet
local chart = import 'chart.jsonnet';
|
|
local common = import 'common.jsonnet';
|
|
local deployment_manifest = import 'deployment_manifest.jsonnet';
|
|
local deployment = deployment_manifest.deployment;
|
|
|
|
if deployment_manifest.deployment.elasticSearch.enabled == true then {
|
|
apiVersion: 'monitoring.coreos.com/v1',
|
|
kind: 'ServiceMonitor',
|
|
metadata: {
|
|
labels: deployment.elasticSearch.esLabels,
|
|
name: deployment.elasticSearch.instance.instanceName + '-elasticsearch-monitor',
|
|
namespace: deployment_manifest.environment + '-datastores',
|
|
annotations: common.annotations,
|
|
},
|
|
spec: {
|
|
endpoints: [
|
|
{
|
|
metricRelabelings: [
|
|
{
|
|
action: 'drop',
|
|
regex: 'es_index_segments_memory_bytes',
|
|
sourceLabels: ['__name__'],
|
|
},
|
|
{
|
|
action: 'drop',
|
|
regex: '.*es-node',
|
|
sourceLabels: ['job'],
|
|
},
|
|
{
|
|
action: 'drop',
|
|
regex: 'es_cluster.*;.*es-node-[1-9]+',
|
|
sourceLabels: ['__name__', 'pod'],
|
|
},
|
|
],
|
|
interval: '30s',
|
|
path: '/_prometheus/metrics',
|
|
port: 'http',
|
|
scheme: 'http',
|
|
tlsConfig: {
|
|
insecureSkipVerify: true,
|
|
},
|
|
basicAuth: {
|
|
password: {
|
|
name: deployment.elasticSearch.instance.instanceName + '-elasticsearch' + '-sm-secret',
|
|
key: 'password',
|
|
},
|
|
username: {
|
|
name: deployment.elasticSearch.instance.instanceName + '-elasticsearch' + '-sm-secret',
|
|
key: 'username',
|
|
},
|
|
},
|
|
},
|
|
],
|
|
namespaceSelector: {
|
|
matchNames: [
|
|
deployment_manifest.environment + '-datastores',
|
|
],
|
|
},
|
|
selector: {
|
|
matchLabels: {
|
|
'common.k8s.elastic.co/type': 'elasticsearch',
|
|
'elasticsearch.k8s.elastic.co/cluster-name': deployment.elasticSearch.instance.instanceName + '-elasticsearch',
|
|
},
|
|
},
|
|
},
|
|
}
|