This section covers how to enable metrics scraping for KubeLB components and set up Grafana dashboards.
Both kubelb-manager and kubelb-ccm Helm charts support two methods for metrics scraping:
If you have the Prometheus Operator installed, enable the ServiceMonitor:
# values.yaml
serviceMonitor:
enabled: true
This creates a ServiceMonitor resource that configures Prometheus to scrape the KubeLB metrics endpoint via kube-rbac-proxy over HTTPS on port 8443.
Ensure your Prometheus instance is configured to discover ServiceMonitors across all namespaces. For kube-prometheus-stack, set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false.
When ServiceMonitor is disabled (default), standard Prometheus pod annotations are added automatically:
prometheus.io/scrape: "true"
prometheus.io/port: "<metrics-port>"
prometheus.io/path: "/metrics"
The internal metrics port can be configured per chart:
| Chart | Value | Default |
|---|---|---|
kubelb-manager | metrics.port | 9443 |
kubelb-ccm | metrics.port | 9445 |
The external scrape port is always 8443 (kube-rbac-proxy).
KubeLB provides pre-built Grafana dashboards that can be automatically provisioned via the Grafana sidecar or manually imported.
Enable dashboard ConfigMaps in the Helm chart:
# values.yaml
grafana:
dashboards:
enabled: true
This creates ConfigMaps with the grafana_dashboard: "1" label, which the Grafana sidecar picks up automatically.
If your Grafana instance runs in a different namespace than KubeLB, ensure the sidecar is configured to search all namespaces: grafana.sidecar.dashboards.searchNamespace=ALL.
Dashboard JSON files are located in the dashboards/ directory within each Helm chart:
Import these via the Grafana UI (Dashboards > Import) or API. All dashboards use a datasource template variable — select your Prometheus data source after import.
A common setup using kube-prometheus-stack:
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--namespace monitoring --create-namespace \
--set grafana.sidecar.dashboards.enabled=true \
--set grafana.sidecar.dashboards.searchNamespace=ALL \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false
Then enable monitoring in KubeLB:
helm upgrade kubelb kubelb-manager \
--namespace kubelb \
--set serviceMonitor.enabled=true \
--set grafana.dashboards.enabled=true
The following dashboard subpages provide detailed descriptions:
For the full list of exposed Prometheus metrics, see the Metric References.