veeso / termscp

🖥 A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3/SMB
https://termscp.veeso.dev
MIT License
1.65k stars 48 forks source link

[Feature Request] - kubectl "protocol" #242

Closed knpwrs closed 2 months ago

knpwrs commented 5 months ago

Description

It would be really cool to be able to browse and copy files to/from services running in kubernetes using termscp. I imagine an initial remote screen could be a listing of namespaces, and when you drill in you can see pods or services running in that namespace, and then you can navigate the file system like normal.

Changes

A kubectl "protocol" would need to be added to termscp.

Implementation

You can copy files to and from pods running on kubernetes like such:

kubectl cp --namespace prod ./local/path pod-name:./remote/path

Remote files can be listed like such:

kubectl exec --namespace prod --stdin --tty pod-name -- ls ./remote/path

Namespaces can be listed as such:

kubectl get namespaces

Using these (and other) commands it should be possible to implement a kubectl protocol to be able to browse and copy files to/from services running in kubernetes.

knpwrs commented 5 months ago

I currently use navi to do very similar things for my running services, just with fuzzy-finding rather than a TUI: https://github.com/knpwrs/dotfiles/blob/f08642f35fe224949ad0c3a959dbe1d3ec24e6f4/home/config/navi/k8s.cheat

veeso commented 2 months ago

So the implementation is done and it'll be released along with 0.14 very soon. Unfortunately, it won't have the possibility to display namespaces, pods and containers atm.

This would require a change in remotefs-kube to have a side client to work with that, which would be cool, but needs to be implemented. So expect this change in a 0.15.