Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hubble: Patch Cilium DaemonSet with hubble-metrics port #1423

Merged

Conversation

lambdanis
Copy link
Contributor

So far when enabling Hubble metrics in hubble enable command, e.g.:

cilium hubble enable --helm-set-string=hubble.metrics.enabled="{http,dns,drop,tcp,flow,icmp,port-distribution}"

the CLI created a hubble-metrics service, but didn't add a hubble-metrics port to Cilium daemonset. Then Hubble metrics were exposed by Cilium, but the hubble-metrics Endpoints object wasn't populated with the Cilium pod IPs. Prometheus scrape configs often rely on Endpoints objects, so this results in Hubble metrics not being scraped.

This patch fixes that by patching the Cilium agent daemonset with a hubble-metrics port if a metrics service is created in hubble enable command.

It's a rough patch and it assumes using the default Hubble metrics port (9965), and Cilium agent name ("cilium"). A proper solution to the problems would be using Helm as backend for all install/update commands (#1396).

Fixes #1422

So far when enabling Hubble metrics in `hubble enable` command, e.g.:
```
cilium hubble enable --helm-set-string=hubble.metrics.enabled="{http,dns,drop,tcp,flow,icmp,port-distribution}"
```
the CLI created a hubble-metrics service, but didn't add a hubble-metrics port
to Cilium daemonset. Then Hubble metrics were exposed by Cilium, but the
hubble-metrics Endpoints object wasn't populated with the Cilium pod IPs.
Prometheus scrape configs often rely on Endpoints objects, so this results in
Hubble metrics not being scraped.

This patch fixes that by patching the Cilium agent daemonset with a
hubble-metrics port if a metrics service is created in `hubble enable` command.

It's a rough patch and it assumes using the default Hubble metrics port (9965),
and Cilium agent name ("cilium"). A proper solution to the problems would be
using Helm as backend for all install/update commands (cilium#1396).

Fixes cilium#1422

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
@lambdanis lambdanis requested a review from a team as a code owner February 28, 2023 21:34
@lambdanis lambdanis temporarily deployed to ci February 28, 2023 21:34 — with GitHub Actions Inactive
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 1, 2023
@tklauser tklauser merged commit d810da3 into cilium:master Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hubble enable doesn't set hubble-metrics port in Cilium agent
3 participants