What are the best practices for accessing a kubernetes pod with sftp or ssh? What are the best practices for accessing a kubernetes pod with sftp or ssh? kubernetes kubernetes

What are the best practices for accessing a kubernetes pod with sftp or ssh?


Containers is a bit different from whole Virtual Machines. With containers you typically only run a single process - your app. Unless your app is a ssh-daemon or an FTP server, it does not support sftp or ssh protocol. It is common for apps in Kubernetes only to use HTTP.

That said, it is possible to run one-off commands in containers using kubectl exec, see Get a Shell to a Running Container

so what are the best practices for managing the files of a webserver type pod? You have to publish the files and their updates

There are two common way to do this:

  • Copy the files to a Dockerfile and build a new container image (this also contains the web server).
  • Upload the files to a Bucket, e.g. AWS S3 or Google Cloud Storage and let the server serve those files.