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).
256
+
239
257
-`loadbalancer.openstack.org/node-selector`
240
258
241
259
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.
@@ -628,3 +646,66 @@ is not yet supported by OCCM.
628
646
Internally, OCCM would automatically look for IPv4 or IPv6 subnet to allocate the load balancer
629
647
address from based on the service's address family preference. If the subnet with preferred
630
648
address family is not available, load balancer can not be created.
649
+
650
+
### Metric endpoint configuration
651
+
652
+
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:
653
+
654
+
```yaml
655
+
kind: Service
656
+
apiVersion: v1
657
+
metadata:
658
+
name: service-with-metric
659
+
namespace: default
660
+
annotations:
661
+
loadbalancer.openstack.org/metrics-enable: "true" # Enable the listener endpoint on the Octavia LoadBalancer (default false)
662
+
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.
704
+
705
+
For more information: https://docs.openstack.org/octavia/latest/user/guides/monitoring.html#monitoring-with-prometheus
706
+
707
+
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
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