You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This annotation is automatically added and it contains the Octavia's Virtual-IP (VIP).
262
+
243
263
-`loadbalancer.openstack.org/node-selector`
244
264
245
265
A set of key=value annotations used to filter nodes for targeting by the load balancer. When defined, only nodes that match all the specified key=value annotations will be targeted. If an annotation includes only a key without a value, the filter will check only for the existence of the key on the node. If the value is not set, the `node-selector` value defined in the OCCM configuration is applied.
@@ -636,3 +656,64 @@ is not yet supported by OCCM.
636
656
Internally, OCCM would automatically look for IPv4 or IPv6 subnet to allocate the load balancer
637
657
address from based on the service's address family preference. If the subnet with preferred
638
658
address family is not available, load balancer can not be created.
659
+
660
+
### Metric endpoint configuration
661
+
662
+
Since Octavia v2.25, Octavia proposes to expose an HTTP Prometheus endpoint. Using the annotation `loadbalancer.openstack.org/metrics-enable`, you will be able to configure this endpoint on the LoadBalancer:
663
+
664
+
```yaml
665
+
kind: Service
666
+
apiVersion: v1
667
+
metadata:
668
+
name: service-with-metric
669
+
namespace: default
670
+
annotations:
671
+
loadbalancer.openstack.org/metrics-enable: "true" # Enable the listener endpoint on the Octavia LoadBalancer (default false)
672
+
loadbalancer.openstack.org/metrics-port: "9100" # Listener's port (default 9100)
> This configuration use the `loadbalancer.openstack.org/load-balancer-vip-address` annotation that will use the Octavia's VIP to fetch the metric endpoint. Adapt it to your Octavia deployment.
712
+
713
+
For more information: https://docs.openstack.org/octavia/latest/user/guides/monitoring.html#monitoring-with-prometheus
714
+
715
+
Grafana dashboard for Octavia Amphora: https://grafana.com/grafana/dashboards/15828-openstack-octavia-amphora-load-balancer/
If the Octavia LoadBalancer is exposed with a public IP, the Prometheus listener is also exposed (at least for Amphora). Even if no critical data are exposed by this endpoint, __it's strongly recommended to apply an allowed cidrs on the listener__ via the annotation `loadbalancer.openstack.org/metrics-allow-cidrs`.
ifannotationValue, ok:=service.Annotations[annotationKey]; ok {
468
+
returnValue:= []string{}
469
+
splitAnnotation:=strings.FieldsFunc( // avoid empty string by using this func instead of strings.split()
470
+
annotationValue, func(rrune) bool {
471
+
returnr==','
472
+
},
473
+
)
474
+
for_, value:=rangesplitAnnotation {
475
+
trimmedValue:=strings.TrimSpace(value)
476
+
iflen(trimmedValue) ==0 {
477
+
continue
478
+
}
479
+
returnValue=append(returnValue, trimmedValue)
480
+
}
481
+
klog.V(4).Infof("Found a Service Annotation: %v = %q", annotationKey, returnValue)
482
+
returnreturnValue
483
+
}
484
+
klog.V(4).Infof("Could not find a Service Annotation; falling back to default setting: %v = %q", annotationKey, defaultSetting)
485
+
returndefaultSetting
486
+
}
487
+
454
488
// getBoolFromServiceAnnotation searches a given v1.Service for a specific annotationKey and either returns the annotation's boolean value or a specified defaultSetting
455
489
// If the annotation is not found or is not a valid boolean ("true" or "false"), it falls back to the defaultSetting and logs a message accordingly.
0 commit comments