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

Add glooctl snapshot cmd #10239

Merged
merged 71 commits into from
Nov 11, 2024
Merged

Add glooctl snapshot cmd #10239

merged 71 commits into from
Nov 11, 2024

Conversation

bleggett
Copy link
Contributor

@bleggett bleggett commented Oct 25, 2024

Description

Adds a glooctl proxy snapshot cmd, which will dump everything the gateway has (stats, config, listeners, endpoints) into a timestamped zipfile, to aid diagnosis of gateway (or non-gateway) problems.

Some of these already exist piecemeal in the tool (config dump, stats dump) but this adds a few extra bobs and creates an artifact.

API changes

Code changes

  • Added glooctl proxy snapshot
  • Changed GetEnvoyAdminData to take any k8s specifier - previously it always assumed (but did not say) you should give it the name of a deployment. Now, it will work with either a kube-style deployment/<name> specifier, or a raw podname. This was added for glooctl proxy snapshot but also affects glooctl proxy dump and glooctl proxy stats.

Docs changes

TBD

Context

Interesting decisions

The existing code for dump and stats actually would always start hitting the port-forwarded endpoint before the port-forwarding was completed - which would always fail and spam spurious messages. This really needs to be fixed properly by the use of a real Golang kube client, but in the interim we can fix it with stdout scans.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

BOT NOTES:
resolves https://github.com/solo-io/solo-projects/issues/7131

Signed-off-by: Benjamin Leggett <[email protected]>
Signed-off-by: Benjamin Leggett <[email protected]>
@github-actions github-actions bot added keep pr updated signals bulldozer to keep pr up to date with base branch work in progress signals bulldozer to keep pr open (don't auto-merge) labels Oct 25, 2024
Copy link

github-actions bot commented Oct 25, 2024

Visit the preview URL for this PR (updated for commit b24e26c):

https://gloo-edge--pr10239-bleggett-add-glooctl-1khsg578.web.app

(expires Mon, 18 Nov 2024 20:09:41 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 77c2b86e287749579b7ff9cadb81e099042ef677

Copy link
Contributor

@sam-heilbron sam-heilbron left a comment

Choose a reason for hiding this comment

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

Looking great! I think this tool will help the usage of capturing actionable information about the running cluster.
I shared some context about potential areas of the code that may solve parts of this already, or areas where we could expand our functionality for better re-use.
I know this is just a draft, but I was hoping to share this to help save you some time in case you were unaware of those code areas. Happy to chat further if it helps!

projects/gloo/cli/pkg/cmd/gateway/dump.go Outdated Show resolved Hide resolved
projects/gloo/cli/pkg/cmd/gateway/dump.go Outdated Show resolved Hide resolved
projects/gloo/cli/pkg/cmd/gateway/dump.go Outdated Show resolved Hide resolved
@bleggett bleggett requested a review from a team as a code owner October 29, 2024 17:18
Signed-off-by: Benjamin Leggett <[email protected]>
@solo-changelog-bot
Copy link

Issues linked to changelog:
https://github.com/solo-io/solo-projects/issues/7131

@bleggett bleggett changed the title [DRAFT] Add glooctl snapshot cmd Add glooctl snapshot cmd Oct 29, 2024
@bleggett bleggett requested a review from sam-heilbron October 29, 2024 19:16
Signed-off-by: Benjamin Leggett <[email protected]>
@bleggett bleggett force-pushed the bleggett/add-glooctl-snapshot-cmd branch from fcb87e5 to 43b5eea Compare October 29, 2024 19:47
@bleggett
Copy link
Contributor Author

Deployer Single gwc and gw create and validate objs [It] correct deployment with sds, AI extension, and floatinguUserId enabled

This unit test failure looks spurious, it's not related to any change here.

@bleggett bleggett added the work in progress signals bulldozer to keep pr open (don't auto-merge) label Nov 7, 2024
@bleggett bleggett removed the work in progress signals bulldozer to keep pr open (don't auto-merge) label Nov 8, 2024
@bleggett
Copy link
Contributor Author

bleggett commented Nov 8, 2024

/kick-ci

@bleggett
Copy link
Contributor Author

bleggett commented Nov 8, 2024

/test

@bleggett
Copy link
Contributor Author

/kick-ci

@bleggett bleggett merged commit e693683 into main Nov 11, 2024
19 checks passed
@bleggett bleggett deleted the bleggett/add-glooctl-snapshot-cmd branch November 11, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep pr updated signals bulldozer to keep pr up to date with base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants