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

CP/DP Split: track agent connections #2970

Merged
merged 4 commits into from
Jan 6, 2025

Conversation

sjberman
Copy link
Collaborator

@sjberman sjberman commented Jan 3, 2025

Added the following:

  • middleware to extract IP address of agent and store it in the grpc context
  • link the agent's hostname to its IP address when connecting and track it
  • use this linkage to pause the Subscription until the agent registers itself, then proceeding

This logic is subject to change as we enhance this (like tracking auth token instead of IP address).

Testing: Verified that connections are mapped properly between CreateConnection and Subscribe calls and that the subscription waits properly. Scaled nginx to multiple replicas and saw all connections.

Closes #2851

Added the following:
- middleware to extract IP address of agent and store it in the grpc context
- link the agent's hostname to its IP address when connecting and track it
- use this linkage to pause the Subscription until the agent registers itself, then proceeding

This logic is subject to change as we enhance this (like tracking auth token instead of IP address).
@sjberman sjberman requested a review from a team as a code owner January 3, 2025 18:20
@github-actions github-actions bot added the chore Pull requests for routine tasks label Jan 3, 2025
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 186 lines in your changes missing coverage. Please review.

Project coverage is 88.61%. Comparing base (6337c97) to head (4e415c4).
Report is 8 commits behind head on change/control-data-plane-split.

Files with missing lines Patch % Lines
internal/mode/static/nginx/agent/command.go 0.00% 63 Missing ⚠️
...static/nginx/agent/grpc/interceptor/interceptor.go 0.00% 43 Missing ⚠️
internal/mode/static/nginx/agent/grpc/grpc.go 0.00% 38 Missing ⚠️
...ternal/mode/static/nginx/agent/grpc/connections.go 0.00% 19 Missing ⚠️
internal/mode/static/nginx/agent/agent.go 0.00% 7 Missing ⚠️
internal/mode/static/nginx/agent/file.go 0.00% 6 Missing ⚠️
internal/mode/static/manager.go 0.00% 5 Missing ⚠️
...al/mode/static/nginx/agent/grpc/context/context.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##           change/control-data-plane-split    #2970      +/-   ##
===================================================================
- Coverage                            89.74%   88.61%   -1.13%     
===================================================================
  Files                                  109      111       +2     
  Lines                                11150    11212      +62     
  Branches                                50       50              
===================================================================
- Hits                                 10007     9936      -71     
- Misses                                1083     1223     +140     
+ Partials                                60       53       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know a lot of this code will end up changing, but are there any files or components you feel confident in that we can write unit tests for now?

internal/mode/static/nginx/agent/command.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/agent/command.go Show resolved Hide resolved
internal/mode/static/nginx/agent/grpc/connections.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/agent/command.go Show resolved Hide resolved
internal/mode/static/nginx/agent/command.go Show resolved Hide resolved
@sjberman
Copy link
Collaborator Author

sjberman commented Jan 3, 2025

I know a lot of this code will end up changing, but are there any files or components you feel confident in that we can write unit tests for now?

Honestly, not really. I think the meat of these functions will change as we implement the next few stories.

sjberman and others added 2 commits January 6, 2025 13:12
Co-authored-by: bjee19 <139261241+bjee19@users.noreply.github.com>
@sjberman sjberman merged commit f8bbcbe into change/control-data-plane-split Jan 6, 2025
21 checks passed
@sjberman sjberman deleted the chore/agent-connection branch January 6, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants