-
Notifications
You must be signed in to change notification settings - Fork 190
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
Adding ClusterIP service in helm chart to expose controller metrics. #73
Conversation
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.
Great! 👍
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.
I don't think this is necessary for any of the default installations we offer. There is no reason to access the controller pods through a service as they offer no network APIs. I would rather see a separate service spec added to cluster gitops alongside the helm chart if a customer wants to expose metrics in this way.
If this is a must, then at least gating the service behind a create: true/false
in the helm values would be required. (Default being false)
There is a metrics api exposed at :8080 in every controller https://github.com/aws-controllers-k8s/runtime/blob/main/pkg/config/config.go#L60-L64 |
LGTM, If we're going with solution, we could also gate the metrics API using service controller flags, thinking |
I understand that, but does Prometheus not detect all metrics servers in every pod by default? |
Good Idea. I will definitely do this.
While prototyping, I did not find this to be the case. I can double check. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, RedbackThomson, vijtrip2 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
AFAIK Prometheus does not detect any metrics at all by default - it needs to be configured for pod discovery |
service: | ||
create: false | ||
type: "ClusterIP" |
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.
@vijtrip2 @RedbackThomson @a-hilaly
Can we rename this to specify that it has to do with the metrics server and not the service controller itself?
Perhaps something like this?
metrics:
service:
# Set to true to automatically create a Kubernetes Service resource for the
# Prometheus metrics server endpoint in controller
create: false
# Which Type to use for the Kubernetes Service?
# See: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
type: ClusterIP
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.
Yep, I will get it done.
@@ -0,0 +1,30 @@ | |||
{{- if .Values.service.create }} |
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.
Can we rename this file to templates/metrics-service.yaml
please?
Description of changes:
Adding ClusterIP service in helm chart to expose controller metrics.
It is much simpler and easier to update prometheus scraping configuration with a static endpoint.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.