FTP to server


For testing purposes, I would like to send to my app I connected via qovery shell some PDF files via FTP. How would I go about it? I already have persistent storage, so I would put the file in that directory.

Hello @moisesrodriguez !

Just to understand, you want to copy some files you have locally to a running application on your cluster?

If so, you can achieve it using kubectl command following those steps:

  1. Download your cluster kubeconfig:

  1. Identify your app’s pod / namespace, to do so, you can list all pods an filter the one you want, using this command:
$ KUBECONFIG=<your-kubeconfig-file> kubectl get pods --all-namespaces | grep '<your-app-name>'

For example (I am looking for an app called tetris-volume):

$ KUBECONFIG=/Users/benjaminch/Downloads/cluster-kubeconfig-9aa9b28a-8945-483c-9251-7a35747f1b21.yaml kubectl get pods --all-namespaces | grep 'tetris'

z9808a16e-test-tls                               app-z4cbad442-tetris-with-volume-0                                1/1     Running            0                  17m
z9808a16e-test-tls                               app-zc0785cb8-tetris-6c66b6c7f9-25sdp                             1/1     Running            0                  2d19h
  1. Uses kubectl cp to copy local file to remote container
$ KUBECONFIG=<your-kubeconfig-file> kubectl cp <path-to-source-file> <pod-namespace>/<pod-name>:<path-to-target-file>

For example:

 $ KUBECONFIG=/Users/benjaminch/Downloads/cluster-kubeconfig-9aa9b28a-8945-483c-9251-7a35747f1b21.yaml kubectl cp /Users/benjaminch/Downloads/v2.png z9808a16e-test-tls/app-z4cbad442-tetris-with-volume-0:/ben
  1. Verify file is properly there, you can usekubectl
$ KUBECONFIG=<your-kubeconfig-file> kubectl exec <your-pod-name> --namespace <your-pod-namespace> -- ls -la <your-volume-path> 


$ KUBECONFIG=/Users/benjaminch/Downloads/cluster-kubeconfig-9aa9b28a-8945-483c-9251-7a35747f1b21.yaml kubectl exec app-z4cbad442-tetris-with-volume-0 --namespace z9808a16e-test-tls -- ls -la /ben 

total 100
drwxrwsr-x    3 root     1000          4096 Jan 29 10:34 .
drwxr-xr-x    1 root     root          4096 Jan 29 10:28 ..
drwxrws---    2 root     1000         16384 Jan 29 10:28 lost+found
-rw-r--r--    1 501      dialout      74751 Jan 29 10:34 v2.png

Or you can use Qovery CLI to ssh into your pod and check if your file is present.

Also, using Qovery CLI, you should be able to verify file presence (qovery shell <qovery-console-url-for-your-app>).

There is maybe another solution using scp directly from the container, but I haven’t tested.

Let me know if it helps.

Thanks @bchastanier

@moisesrodriguez ,

My 2 cents - an easiest way would be simply upload your PDF into a S3 bucket or HTTP server (GitHub repo) and downloading your PDF while being connected to your app with the qovery shell command.

1 Like

@rophilogene @bchastanier

Thank you for both answers! @bchastanier your tutorial is exactly what I was asking for. But I must say that @rophilogene solution is pretty neat too.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.