chore: WIP - native sidecar fixes and test run #14566
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Code Fixes
Running services in init containers is rare. The following changes address those rare cases, but most importantly, when Linkerd runs in native sidecar mode it exposes metrics in a port behind an init container, which might be impacted by these issues:
Destination controller:
opaque-ports
annotation wasn't considering ports in init containers.Proxy injection (inject.go):
Healtchecks (healthcheck.go): The check "opaque ports are properly annotated" wasn't considering opaque ports in init containers.
CLI (policy.go): The
linkerd authz
command wasn't considering policies applied to ports in init containers.Tests changes
proxy.nativeSidecar: true
, for all tests to run in that mode without further changescurl.rs
in the policy tests so it doesn't block on waiting for the proxy container to terminateNote that k8s started supporting native sidecars without additional feature flags in v1.28. For this reason the following tests aren't supposed to pass: