-
Notifications
You must be signed in to change notification settings - Fork 9
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
packages/kata-debug-shell: init #1022
Conversation
container_info=$(k3s ctr c info "$1") | ||
|
||
sbx_id=$(echo "$container_info" | jq -r '.Spec.annotations."io.kubernetes.cri.sandbox-id"') | ||
runtime_class_name=$(echo "$container_info" | jq -r '.Snapshotter' | cut -c7-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this script accepted a pod ID instead of a container ID, you could simplify it to
container_info=$(k3s ctr c info "$1") | |
sbx_id=$(echo "$container_info" | jq -r '.Spec.annotations."io.kubernetes.cri.sandbox-id"') | |
runtime_class_name=$(echo "$container_info" | jq -r '.Snapshotter' | cut -c7-) | |
runtime_class_name=$(k3s crictl pods --id "$1" -o json | jq -r '.items[0].runtimeHandler') |
Did you have a particular reason to use the container id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always found the container ID to be very present in K9s, so I just went with that. I don't think you see the pod UID in K9s at all, without going into the editing window.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see - TIL that container ids are part of the pod status. Should we maybe change the AKS instructions accordingly? Going via kubectl seems more elegant than crictl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As opposed to crictl
, this would require one more step to translate container ID into sandbox ID though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually (not in this PR), we need to clean up the scripts - I can't say I like how they pile up in packages/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. IMHO, we'd want to move scripts out of there altogether and have it purely as a Nix tree, possibly adding more nesting (as lib.packagesFromDirectoryRecursive
can deal with arbitrary nesting).
This adds a little helper script to get a shell into a bare-metal Kata pod VM with a single command.
723e84a
to
9b786ba
Compare
This adds a little helper script to get a shell into a bare-metal Kata pod VM with a single command.