Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceMonitor for elastic-cluster deployed by elastic-operator #344

Open
therus000 opened this issue May 12, 2022 · 1 comment
Open

ServiceMonitor for elastic-cluster deployed by elastic-operator #344

therus000 opened this issue May 12, 2022 · 1 comment

Comments

@therus000
Copy link

therus000 commented May 12, 2022

Good day
i already installed prometheus exporter plugin while deploy and elastic with operator.
now i stuck on how deploy a servicemonitor to export target to prometheus

`
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: elastic-cluster
#namespace: monitoring
spec:
endpoints:

interval: 20s
path: "/_prometheus/metrics"
port: https
scheme: https
tlsConfig:
insecureSkipVerify: true
basicAuth:
password:
name: secrets-values
key: basic_auth_password
username:
name: secrets-values
key: basic_auth_user
namespaceSelector:
matchNames:
elastic-cluster
selector:
matchLabels:
common.k8s.elastic.co/type: elasticsearch
elasticsearch.k8s.elastic.co/cluster-name: elastic-cluster`

maybe someone tell how to deploy the password and the user of elastic to service monitor?

dev tool show that plugin installed
elastic-cluster-es-node-1 prometheus-exporter 7.17.0.0
elastic-cluster-es-coordinator-0 prometheus-exporter 7.17.0.0
elastic-cluster-es-node-0 prometheus-exporter 7.17.0.0
elastic-cluster-es-node-2 prometheus-exporter 7.17.0.0
elastic-cluster-es-coordinator-1 prometheus-exporter 7.17.0.0

@dancristiancecoi
Copy link

Here is an example on how to create a ServiceMonitor that takes the basic auth details from a secret:

https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/basic-auth.md

Just point it to the secret created by the elastic operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants