-
Notifications
You must be signed in to change notification settings - Fork 669
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
chore: add required service when serviceMonitor is enabled #1509
base: master
Are you sure you want to change the base?
chore: add required service when serviceMonitor is enabled #1509
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @bendikp. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Some users might deploy their own service monitor. Or, use a different mechanism for consuming services. I wonder whether the charts are expected to provide a "full" installation by default. Or, rather ask users to be more aware of what they do. |
Choosing the abstraction of the charts isn't easy. I guess I'm just used to getting a Having a more functional value like |
That would cause strange cases like I wonder if there's any precedence for cases like this. I.e. a higher level abstraction on top of the existing chart configuration. |
If I look at a couple of the helm charts that I consume, they all do this in a slightly different way, however I think in general most charts enable the metrics service when metrics is enabled, and enable the service monitor when service monitor is also enabled.
However some charts do enable the service also when the service monitor is enabled: Cillium: Cilium: https://github.com/cilium/cilium/blob/685790550b375380dd8fac71cc2a37427d78fc40/install/kubernetes/cilium/templates/cilium-agent/service.yaml#L3 In general the helm construct I see most often in the helm charts I consume is the following: metrics:
enabled: true # Enabled metrics port and enables metrics service
serviceMonitor:
enabled: true # Enables ServiceMonitor that consumes metrics service |
@rouke-broersma thank you for exploring the existing solutions. Yeah, this change requires to reshape the current charts "api". So when the metrics are enabled, the service monitor (enabled by default) needs to be explicitly disabled if its functionality is not needed. |
@bendikp would you be interested in reshaping the current chart configuration structure? |
Just to clear, the most common case is that both {{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled -}} While the ask in this PR is: {{- if or .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled -}} Eg of the common case: This enables metrics service and optionally metrics port (on container) but not serviceMonitor: metrics:
enabled: true This does not enable anything: metrics:
enabled: false
serviceMonitor:
enabled: true This enables all of metrics port (on container), metrics service and serviceMonitor: metrics:
enabled: true
serviceMonitor:
enabled: true |
/ok-to-test |
Currently when enabling serviceMonitor the service isn't automatically enabled, and you have to explicitly enable the service in order for the serviceMonitor to work.
I think it would be nice to add the service when you enable serviceMonitor. Especially since the serviceMonitor don't work when you don't have a service.