kubernetes / cloud-provider-openstack

Apache License 2.0
623 stars 611 forks source link

[occm] Support Octavia/Amphora Prometheus endpoint creation using annotations #2633

Open Lucasgranet opened 3 months ago

Lucasgranet commented 3 months ago

What this PR does / why we need it: Adds the ability to add a Prometheus listener on the Octavia LoadBalancer in order to fetch it with any Prometheus scrapper to get metrics from the LoadBalancer.

This PR brings 4 new annotations:

loadbalancer.openstack.org/metrics-enable: "true" # Enable the listener endpoint on the Octavia LoadBalancer (default false)
loadbalancer.openstack.org/metrics-port: "9101" # Listener's port (default 9100)
loadbalancer.openstack.org/metrics-allow-cidrs: "10.0.0.0/8, fe80::/10" # Listener's allowed cidrs (default none) - see below
loadbalancer.openstack.org/load-balancer-vip-address: "10.4.2.3" #  Auto-computed field based on Octavia VIP

Why you should have to use loadbalancer.openstack.org/metrics-allow-cidrs

It's strongly recommended to apply an allowed cidrs on the listener. If a Floating IP is attached to the Octavia, the metric endpoint will be exposed publicly. Apply a restriction to the K8S's subnet is recommended.

More detail on the Prometheus listener: https://docs.openstack.org/octavia/latest/user/guides/monitoring.html#monitoring-with-prometheus

Which issue this PR fixes(if applicable): fixes #2465

Special notes for reviewers: A new E2E test has been added.

Release note:

[openstack-cloud-controller-manager] Support Octavia/Amphora Prometheus endpoint creation using annotations
k8s-ci-robot commented 3 months ago

Hi @Lucasgranet. Thanks for your PR.

I'm waiting for a 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.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
jichenjc commented 2 months ago

/ok-to-test

Lucasgranet commented 2 months ago

Hello,

Have you any feedback or questions about this PR?

Lucasgranet commented 1 month ago

Hello, @jichenjc @dulek,

If you have some time, would you mind reviewing this PR please?

Thank you,

k8s-ci-robot commented 3 weeks ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign kayrus for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubernetes/cloud-provider-openstack/blob/master/OWNERS)** 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 commented 1 week ago

PR needs rebase.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.