Skip to content

feat: enhance debug session management with resource and network policy options #24

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DragonStuff
Copy link
Collaborator

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.

…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.
@DragonStuff DragonStuff self-assigned this May 24, 2025
Copy link
Contributor

@zakame zakame left a comment

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

seems unused

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
)
Copy link
Contributor

Choose a reason for hiding this comment

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

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused exit_code


cmd = "".join(
[
f"{kubectl} run -it --rm --restart=Never --namespace={namespace} ",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we restore auto-pruning the debug session when done as an --rm flag?


# Add NetworkPolicy targeting label if needed
if network_policy:
labels["debug-pod"] = pod_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants