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

feat: implement egctl x access logs #1887

Closed
wants to merge 5 commits into from

Conversation

shawnh2
Copy link
Contributor

@shawnh2 shawnh2 commented Sep 13, 2023

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1812

Signed-off-by: sh2 <shawnhxh@outlook.com>
Signed-off-by: sh2 <shawnhxh@outlook.com>
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Attention: 219 lines in your changes are missing coverage. Please review.

Comparison is base (a324513) 65.24% compared to head (52d1934) 65.34%.
Report is 354 commits behind head on main.

Files Patch % Lines
internal/cmd/egctl/accesslogs.go 37.89% 207 Missing and 11 partials ⚠️
internal/cmd/egctl/experimental.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1887      +/-   ##
==========================================
+ Coverage   65.24%   65.34%   +0.10%     
==========================================
  Files          86       87       +1     
  Lines       12480    13226     +746     
==========================================
+ Hits         8142     8642     +500     
- Misses       3821     4045     +224     
- Partials      517      539      +22     

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

}
}

func serveAccessLogServer(ctx context.Context, server *grpc.Server, addr string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

im guessing you are running this in the client machine where egctl is being run
it may not be possible for to create a grpc conn between the server and envoy

maybe the easiest way is to scrape pod logs of envoy using kubectl

Copy link
Contributor Author

@shawnh2 shawnh2 Sep 14, 2023

Choose a reason for hiding this comment

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

the basic idea of this PR is to implement an access-log server which receives access-logs from envoy as its endpoint.

we can create a connection between server and envoy if we apply the envoy-patch-policy successfully (for example, like internal/cmd/egctl/testdata/accesslogs/test-access-logs.yaml in this PR).

so the operations for egctl x access-logs will be: start the access-log server locally, apply the envoy-patch-policy for envoy, and access-log server will start to receive access logs.

Copy link
Contributor Author

@shawnh2 shawnh2 Sep 16, 2023

Choose a reason for hiding this comment

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

the basic implementation of this subcmd has done, just left some doc and unit test.

PTAL

Copy link
Contributor

Choose a reason for hiding this comment

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

hi @shawnh2 lets assume im running this cmd from my macbook into a cluster that is running in GKE.
if you are running this access logs server locally on your Mac, how can you expect the envoy running in GKE to connect back ? routing rules will not exist

Copy link
Contributor Author

@shawnh2 shawnh2 Sep 20, 2023

Choose a reason for hiding this comment

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

this cmd works if you are running this access logs server in the same place that runs the cluster (for example also run this cmd in GKE), but won't work if you are running this cmd from your local macbook (there's no routing rules for sure).

imo, this cmd should work in both scenario, but this PR only implement the first.

do you think the first scenario is necessary? or should we only focus on the second for now?

Signed-off-by: sh2 <shawnhxh@outlook.com>
Signed-off-by: sh2 <shawnhxh@outlook.com>
Signed-off-by: sh2 <shawnhxh@outlook.com>
@shawnh2 shawnh2 changed the title WIP: implement egctl x access logs feat: implement egctl x access logs Sep 16, 2023
@shawnh2 shawnh2 marked this pull request as ready for review September 16, 2023 14:53
@shawnh2 shawnh2 requested a review from a team as a code owner September 16, 2023 14:53
@shawnh2 shawnh2 requested a review from arkodg September 16, 2023 14:53
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale label Oct 20, 2023
@github-actions github-actions bot removed the stale label Dec 20, 2023
Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale label Jan 20, 2024
@shawnh2
Copy link
Contributor Author

shawnh2 commented Jun 19, 2024

Closing this one, due to staleness and wrong implementation direction.

@shawnh2 shawnh2 closed this Jun 19, 2024
@shawnh2 shawnh2 deleted the egctl-access-log branch June 19, 2024 06:34
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.

egctl x access-logs
2 participants