Skip to content

fix(policy-controller): properly index named ports in native sidecar containers#14144

Merged
alpeb merged 1 commit into
mainfrom
alpeb/prom-auth-nativesidecars
Jun 17, 2025
Merged

fix(policy-controller): properly index named ports in native sidecar containers#14144
alpeb merged 1 commit into
mainfrom
alpeb/prom-auth-nativesidecars

Conversation

@alpeb

@alpeb alpeb commented Jun 16, 2025

Copy link
Copy Markdown
Member

Closes #14103

Prometheus wasn't't able to scrape metrics on proxies injected as native sidecar containers in workloads with a restrictive inbound policy (see #14103 for repro).

The cause was the function in charge of indexing ports by name (pod_tcp_ports_by_name) wasn't considering init containers.

This fix also expands the probe_multiple_paths unit test to include probe ports in init containers, but that was working fine.

A new test tcp_ports_by_name was introduced that didn't pass without this fix.

@alpeb alpeb requested a review from a team as a code owner June 16, 2025 23:34
@alpeb alpeb changed the title fix(policy-controller): properly index named ports in sidecar containers fix(policy-controller): properly index named ports in native sidecar containers Jun 16, 2025
@alpeb alpeb force-pushed the alpeb/prom-auth-nativesidecars branch from d1b894f to 4c6a96d Compare June 17, 2025 21:13
Closes #14103

Prometheus wasn't't able to scrape metrics on proxies injected as
sidecar containers in workloads with a restrictive inbound policy (see
#14103 for repro).

The cause was the function in charge of indexing ports by name
(`pod_tcp_ports_by_name`) wasn't considering init containers.

This fix also expands the `probe_multiple_paths` unit test to include
probe ports in init containers, but that was working fine.

A new test `tcp_ports_by_name` was introduced that didn't pass without
this fix.
@alpeb alpeb merged commit 8d5c805 into main Jun 17, 2025
73 of 75 checks passed
@alpeb alpeb deleted the alpeb/prom-auth-nativesidecars branch June 17, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inbound policy can't be applied to metrics port (4191) when using native sidecar containers

2 participants