Ask questionsAdd support for browsing file system of Kubernetes pods (containers)
For example see: https://marketplace.visualstudio.com/items?itemName=sandipchitale.kubernetes-file-system-explorer.
kubectl exec -it podname -c containername -- ls /
to get the listings of files starting at /. Show them as tree nodes. Also using the command:
kubectl exec -it podname -c containername -- cat /path/to/file
and showing the returned content in a editor.
BTW the extension also shows the initContainers and Containers in a pod. Shows the filesystems of the running containers.
Both supported by the extension above.
Lastly even better option would be to support dual pane file browser for local and container filesystem. Use the the:
kubectl cp fom podname:/to
to copy files from/to.
Use the https://code.visualstudio.com/api/references/vscode-api#FileSystemProvider API to implement the container filesystem browser.
Answer questions sandipchitale
@bhack thanks for the reference. I agree that will be more complete solution. My integration was a quick and simple implementation to get browsing going.
In first comment I suggested using FileSystemProvider based on Kubectl command integration via this extension.