cloud-provider-openstack icon indicating copy to clipboard operation
cloud-provider-openstack copied to clipboard

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

Open Lucasgranet opened this issue 1 year ago • 8 comments
trafficstars

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

Lucasgranet avatar Aug 22 '24 13:08 Lucasgranet