feat: enhance debug session management with resource and network policy options - #24
Open
DragonStuff wants to merge 2 commits into
Open
feat: enhance debug session management with resource and network policy options#24DragonStuff wants to merge 2 commits into
DragonStuff wants to merge 2 commits into
Conversation
…cy options Added support for specifying CPU and memory requests/limits, custom environment variables, and network policies when creating debug pods. Introduced commands for listing, resuming, and terminating debug sessions, improving overall session management capabilities.
zakame
suggested changes
May 26, 2025
zakame
left a comment
Contributor
There was a problem hiding this comment.
Nice work, we even got a session manager going! 👍
ruff check/ruff format --check picked up a few nits - we can probably add that in as a GHA workflow too.
| """kubectl-application-shell package""" | ||
|
|
||
| import sys | ||
| from typing import List |
Comment on lines
+13
to
+16
| get_deployment_info, get_kubectl, get_kube_version, create_network_policy, | ||
| delete_network_policy, get_user_identifier, list_debug_sessions, | ||
| get_debug_session, terminate_debug_session, resume_debug_session | ||
| ) |
Contributor
There was a problem hiding this comment.
the *_debug_session functions seems unused here (they're all supposed to be in .cli anyway)
| console.print(f":memo: Logging session to {session_log}") | ||
|
|
||
| try: | ||
| exit_code = os.system(cmd) |
|
|
||
| cmd = "".join( | ||
| [ | ||
| f"{kubectl} run -it --rm --restart=Never --namespace={namespace} ", |
Contributor
There was a problem hiding this comment.
Could we restore auto-pruning the debug session when done as an --rm flag?
zakame
reviewed
May 26, 2025
|
|
||
| # Add NetworkPolicy targeting label if needed | ||
| if network_policy: | ||
| labels["debug-pod"] = pod_name |
Contributor
There was a problem hiding this comment.
Also this pod_name is used ahead of being defined below in https://github.com/tablecheck/kubectl-application-shell/pull/24/files#diff-065b3beb658a1a078c181cd4cabdfc8218ff1a3426c15d736f4121e449c706d6R270
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added support for specifying CPU and memory requests/limits, custom environment variables, and network policies when creating debug pods. Introduced commands for listing, resuming, and terminating debug sessions, improving overall session management capabilities.