Skip to content

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

Open
DragonStuff wants to merge 2 commits into
masterfrom
DragonStuff/better-options
Open

feat: enhance debug session management with resource and network policy options#24
DragonStuff wants to merge 2 commits into
masterfrom
DragonStuff/better-options

Conversation

@DragonStuff

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

@zakame zakame left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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