profile
viewpoint

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.

Basically uses:

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.

Azure/vscode-kubernetes-tools

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.

useful!

Related questions

Unable to connect to the server: proxyconnect tcp: dial tcp 127.0.0.1:3128: connectex: No connection could be made because the target machine actively refused it. hot 1
"command 'extension.vsKubernetesRefreshExplorer' not found" on code-server hot 1
Github User Rank List