Skip to content

fix: refresh dedicated identity when the bound Pod changes - #41

Open
Kuromesi wants to merge 1 commit into
openkruise:masterfrom
Kuromesi:fix-pod-bound-identity-refresh
Open

Kuromesi wants to merge 1 commit into
openkruise:masterfrom
Kuromesi:fix-pod-bound-identity-refresh

Conversation

@Kuromesi

Copy link
Copy Markdown
Contributor

A restored dedicated ztunnel can receive a JWT bound to a replacement Pod while retaining the same SPIFFE identity. Its cached certificate and pooled HBONE connections can still identify the previous Pod, preventing gateway traffic from recovering even after ADS reconnects successfully.

Snapshot the JWT on each dedicated ADS connection and use its Pod UID to partition certificate requests and HBONE pool entries. When the Pod changes, discard the previous certificate cache and prevent its in-flight signing results from filling the new cache. Normal token renewal for the same Pod keeps its certificates and connections. This adds no configuration or per-request token-file reads and leaves shared-mode identity handling unchanged.

Validation on Linux with Rust 1.90.0:

  • 391 unit tests, 17 direct integration tests, and the separate multi-root certificate test passed.
  • Regression coverage includes projected token replacement, ADS reconnects, same-Pod renewal, in-flight signing across Pod replacement, and HBONE connection reuse.
  • cargo check --locked, cargo clippy --locked --lib --bins, formatting, and the repository copyright check passed.

The platform must supply a JWT bound to the new Pod. This change cannot repair a restored projected volume that still contains the old Pod JWT. Natural ACS deep-sleep recovery and the full privileged firewall test suite were not rerun for this PR. Existing in-flight streams are not forcibly terminated.

Signed-off-by: Kuromesi <blackfacepan@163.com>
@kruise-bot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from kuromesi by writing /assign @kuromesi in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants