This article describes the deployment of a trial SFTPPlus engine using an already created Google Cloud Platform Kubernetes Engine service (GKE).


This article describes the deployment of a trial SFTPPlus engine using an already created Google Cloud Platform Kubernetes Engine service (GKE).
The example Kubernetes YAML file can be found in our GitHub SFTPPlus Kubernetes repository while the container source available at our GitHub SFTPPlus Docker repository.
The actual user data is persisted using a single Google Cloud Storage bucket.
You can adapt the example from this article to any other Kubernetes system, like OpenShift, Azure Kubernetes Service (AKS) or Amazon AWS.
We would love to hear your feedback. Get in touch with us for comments or questions.
Once completing the steps in this guide, you will have an SFTPPlus application with the following services:
All these services will be available via the public IP address associated with your load balancer.
The Google Cloud storage bucket is made available inside each container as the /srv/storage local path.
SFTPPlus also supports legacy FTP, explicit or implicit FTPS or plain HTTP file access. They are not included in this guide to reduce the complexity of the provided information and configuration.

To deploy SFTPPlus into the cluster we will use the following components:
Since the persistent data is stored outside the cluster, we need to setup the authentication to your cloud storage bucket from within the Kubernetes cluster.
We assume that you will use the Google Cloud console to create the storage bucket and the Service account.
Once the Service account is created, create a new credentials key or associate with an existing one.
You will need to upload/copy the Service account's credential key to your cloud shell. For this example we assume that the file is named gcs-credentials.json and the secret is created using the sftpplus.gcs.credentials name. Then it can be imported into Kubernetes using the following command line:
kubectl create secret generic sftpplus.gcs.credentials \
--from-file gcs-credentials.jsonFor accessing the SFTPPlus over the Internet we will use a standard Kubernetes Load Balancer service .
Below, you can find an example YAML file named sftpplus-service.yaml that can be copied to your cloud console.
apiVersion: v1
kind: Service
metadata:
finalizers:
- service.kubernetes.io/load-balancer-cleanup
labels:
app: sftpplus-app
name: sftpplus-app-load-balancer
namespace: default
spec:
externalTrafficPolicy: Cluster
ports:
- name: 10020-to-10020-tcp
nodePort: 30500
port: 10020
protocol: TCP
targetPort: 10020
- name: 443-to-10443-tcp
nodePort: 32013
port: 443
protocol: TCP
targetPort: 10443
- name: 22-to-10022-tcp
nodePort: 32045
port: 22
protocol: TCP
targetPort: 10022
selector:
app: sftpplus-app
sessionAffinity: None
type: LoadBalancerIf you want to have the SFTPPlus services available on other port numbers, you can do so by updating the port configuration values. nodePort and targetPort don't need to be updated.
Create or update the load balancer service with the following command.
kubectl apply -f sftpplus-service.yamlThe SFTPPlus application will be deployed as a container inside a pod.
The configuration and data is persisted outside of the cluster, using a cloud storage bucket
The deployment to the cluster can be done using the following YAML file named sftpplus-workload.yaml.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: sftpplus-app
name: sftpplus-app
namespace: default
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: sftpplus-app
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: sftpplus-app
spec:
containers:
- env:
- name: GCS_BUCKET
value: sftpplus-trial-srv-storage
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /srv/gcs-credentials/gcs-credentials.json
image: proatria/sftpplus-trial:4.12.0-cloud
imagePullPolicy: Always
lifecycle:
preStop:
exec:
command:
- fusermount
- -u
- /srv/storage
name: sftpplus-trial
resources: {}
securityContext:
privileged: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /srv/gcs-credentials
name: gcs-credentials-key
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: gcs-credentials-key
secret:
defaultMode: 420
secretName: sftpplus.gcs.credentialsYou should replace sftpplus-trial-srv-storage with the name of your storage bucket.
This does the following:
/srv/storage./srv/gcs-credentials/gcs-credentials.json file, available via the cluster secrets.With the YAML file available in the cloud console, you can create or upload the workload by using the following command.
kubectl apply -f sftpplus-workload.yaml