Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Add service resource for the controller manager #2431

Merged
merged 3 commits into from
Apr 22, 2019
Merged

Add service resource for the controller manager #2431

merged 3 commits into from
Apr 22, 2019

Conversation

sebastien-prudhomme
Copy link
Contributor

This PR is a

  • [x ] Feature Implementation
  • Bug Fix
  • Documentation

What this PR does / why we need it:

This PR enables to use Prometheus Operator ServiceMonitor to scrap metrics on the controller manager.

This PR adds a service resource for the controller manager in the Helm chart.

Merge Checklist:

  • New feature
    • Tests
    • Documentation
  • SVCat CLI flag
  • Server Flag for config
    • Chart changes
    • removing a flag by marking deprecated and hiding to avoid
      breaking the chart release and existing clients who provide a
      flag that will get an error when they try to update

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 22, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @sebastien-prudhomme. Thanks for your PR.

I'm waiting for a kubernetes-incubator or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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/test-infra repository.

@jboyd01
Copy link
Contributor

jboyd01 commented Oct 22, 2018

Hey @sebastien-prudhomme, thanks for the PR. I've got a couple questions/thoughts.

Instead of creating a Service for the Controller, have you tried enabling enablePrometheusScrape in values.yaml? https://github.com/kubernetes-incubator/service-catalog/blob/58b88f4d33cb708e4b22c39ccbe498b00738488e/charts/catalog/values.yaml#L161-L162

This will cause the the annoation prometheus.io/scrape to be added to each pod. To my knowledge this annotation works with most Prometheus deployments enabling the Controller pods to be scraped. I have not tried it with the Prometheus Operator myself.

If we create the Service to enable Prometheus scraping, is there additional configuration required in the Prom Operator to cause it to scrape services?

Is the NodePort required for Prometheus? This has side effects such as exposing the Catalog Controller to external access.

If we do merge this PR I'd like to get some documentation around it including any assumptions with regards to the Operator configuration. Perhaps update https://github.com/kubernetes-incubator/service-catalog/tree/master/contrib/examples/prometheus ?

@sebastien-prudhomme
Copy link
Contributor Author

Hi @jboyd01 Sure you can have automatic scrape directly on pods by using the right annotations but this is not compatible with the prometheus operator and have some limitations, that's why the prometheus operator dev team introduced the ServiceMonitor resource.

You need the Service resource AND a ServiceMonitor resource that have a selector for the service. The service just need an IP, so ClusterIP service type is enough, no need to expose the service in the external world. My fault as i just copy paste what was done for the other service. Will correct it.

The advantage of the prometheus operator is that you can also declare alert rules in your YAML kubernetes files.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 22, 2018
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 23, 2018
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 6, 2019
@jberkhahn
Copy link
Contributor

/ok-to-test

I'm not certain we need this on by default.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 7, 2019
@jberkhahn
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2019
@jboyd01
Copy link
Contributor

jboyd01 commented Apr 22, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jboyd01

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 22, 2019
@k8s-ci-robot k8s-ci-robot merged commit f3c7d26 into kubernetes-retired:master Apr 22, 2019
viviyww pushed a commit to viviyww/service-catalog that referenced this pull request May 10, 2019
)

* Add service resource for the controller manager

Signed-off-by: Sébastien Prud'homme <[email protected]>

* Use ClusterIP for controller manager Service type

Signed-off-by: Sébastien Prud'homme <[email protected]>
@sebastien-prudhomme sebastien-prudhomme deleted the controller-manager-service branch May 16, 2019 12:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants