-
Notifications
You must be signed in to change notification settings - Fork 719
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
[Helm] Add optional podLabels to operator pod and Expose Metrics ports #4424
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
1 similar comment
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
💚 CLA has been signed |
Signed-off-by: Oliver Bähler <oliver.baehler@bedag.ch>
Jenkins test this please. |
Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
My latests commit adds the option to deploy a podMonitor with the eck-operator. I tested it locally and it seemed to work fine. Let me know what you think :) |
Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
Is there any timeframe on when this will be included? :) (if even) |
Jenkins test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
For the record I did a test using the following Prometheus resource:
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus
namespace: prom
spec:
podMonitorNamespaceSelector:
matchLabels:
prometheus: monitoring
podMonitorSelector:
matchLabels:
team: eck
Once created the operator namespace has been labeled with prometheus=monitoring
Then the Helm chart has been deployed with the following command:
% helm install --devel --debug my-elastic-operator my-eck/eck-operator --set=config.metricsPort=9090 --set=image.tag=1.5.0 --set=podMonitor.enabled=true --set=podMonitor.labels.team=eck
Which triggered the creation of the podMonitor
resource:
% k get podmonitors.monitoring.coreos.com
NAME AGE
elastic-operator 2m30s
I was also able to get the operator metrics in the Prometheus console.
Thanks !
Signed-off-by: Oliver Bähler oliver.baehler@bedag.ch
This Pull Request adds two new features:
config.metricsPort
value is not0
a port on the container is exposed with that value. Currently this port is not exposed which makes it impossible for a prometheus monitor to scrape them.podLabels
adds the option to label the operator pod with additional labels. We currently have the use case that we need to add some labels to the pod and that option currently does not exist.I was also wondering if it would be interesting to have a prometheus serviceMonitor built-in to the chart? So that endusers could just flick some options and have their metrics scraped by prometheus. Let me know if that's something you see would add value to the chart and I will be willing to commit the code to this pull request :).