Skip to content

Create the node metrics service for Calico - #5134

Draft
caseydavenport wants to merge 2 commits into
tigera:masterfrom
caseydavenport:casey-felix-metrics-service
Draft

Create the node metrics service for Calico#5134
caseydavenport wants to merge 2 commits into
tigera:masterfrom
caseydavenport:casey-felix-metrics-service

Conversation

@caseydavenport

Copy link
Copy Markdown
Member

Description

The operator already creates metrics Services for Typha and kube-controllers, but not for Felix, so Calico users following the component metrics guide have to hand-roll one. This renders the existing calico-node-metrics Service for Calico too, carrying only Felix's port, and removes it again if Felix metrics are turned back off. Enterprise keeps its reporter and BGP ports, unchanged.

Also fixes the Felix metrics port being read out of FelixConfiguration only for Enterprise. Nothing consumed it in a Calico install before this change, but with the Service rendered it would have pointed at the default port no matter what the user configured.

Windows is not covered here. The Windows metrics Service has never carried Felix's port, even in Enterprise, and getting one to work needs a firewall rule, so it wants its own change.

Related: projectcalico/calico#10755

Release Note

Calico installations now get a Service for scraping Felix Prometheus metrics when Felix metrics are enabled, so one no longer has to be created by hand.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

The port configured in FelixConfiguration applies to Calico as well as Enterprise.
Calico gets a service carrying only Felix's port, and only once Felix metrics
are enabled. Enterprise keeps its reporter and BGP ports.
@caseydavenport

Copy link
Copy Markdown
Member Author

Marking this a draft. The gating is wrong: nodeMetricsPort enables Felix metrics by setting env on calico-node rather than writing the port to FelixConfiguration, so this misses anyone who enabled metrics that way, and targets the wrong port when both paths are set with different values.

nodeMetricsPort should be writing the port to FelixConfiguration like we already do for eBPF and nftables, which reduces this to a couple of lines. That has the operator owning fields a user may have set themselves, so it's waiting on #4523. Background in projectcalico/calico#10755.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants