Work in Progress. OpenShift job based on the image of Apline Linux with sftp client added to it. The job runs upload.sh script that gets injected via ConfigMap.
Build the image.
Configure runtime.
oc process -f app.cm.yaml -p P_SFTP_CONNECTION="your_user@your_sftp_server" -p P_SFTP_UPLOAD_DIR="/your_upload_dir" -p P_ARCHIVE_RETENTION_DAYS="60" | oc apply -f -
This will create the following config maps:
Additionally the is one secret to be created: secret name: medis-sftp-secret, key name: medis-etl-ssh-key. The key contains ssh private key used to connect to remote SFTP server. Gets mount as a file on the pod running sftp job
Kick new job to upload the files to remote SFTP server.
oc process -f app.job.yaml -p TS=date +%Y%m%d%H%M%S
| oc apply -f -