sftp

by ygqygq2

Helm chartv2.0.0App 1.0Verified publisher

A Helm chart for sftp

About this chart

sftp - Securely share your files

sftpdocker

Introduction

部署一个sftp服务用于上传下载文件,如果是挂载的多读写的PVC,可用于提供文件的修改入口,比如修改web服务文件。

Prerequisites

  • Kubernetes 1.6+
  • PV provisioner support in the underlying infrastructure

Installing the Chart

To install the chart with the release name my-sftp:

$ helm install --name my-sftp sftp  # helm2
$ helm install my-sftp sftp  # helm3

The command deploys sftp cluster on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

运行后看到输出:

ME: my-sftp
LAST DEPLOYED: 2019-07-24 23:25:09.557535712 +0800 CST m=+0.066477189
NAMESPACE: default
STATUS: deployed

NOTES:
** Please be patient while the chart is being deployed **

Connect to the sftp:

  export POD_NAME=$(kubectl get pods --namespace default -l "app=sftp" -l "release=my-sftp" -o jsonpath="{.items[0].metadata.name}")
  kubectl port-forward $POD_NAME 1222:22 --namespace default

  # login sftp, default user is "dev", default password is "dev".
  sftp -o port=1222 [email protected]

执行完 NOTES 中提示命令的命令即可使用sftp命令登录至sftp。

Uninstall

To uninstall/delete the my-sftp deployment:

$ helm delete my-sftp [--purge]  # helm2
$ helm delete my-sftp   # helm3

Configuration

The following table lists the configurable parameters of the sftp chart and their default values.

ParameterDescriptionDefault
replicaCountreplicas number1
sshConfFilesftp ssh config filelook it in values.yaml
usersConfFilesftp users config filelook it in values.yaml
scriptFiledocker start to run this scriptlook it in values.yaml
serviceService type, protocol, portClusterIP TCP 22
imagesftp image, tag.ygqygq2/sftp latest
persistentVolume.enabledCreate a volume to store datafalse
persistentVolume.storageClassType of persistent volume claimnil
persistentVolume.accessModesPersistent volume access modes[ReadWriteMany]
persistentVolume.sizePersistent volume access modes500Mi
persistentVolume.existingClaimPersistent volume existingClaim name[]
persistentVolume.annotationsPersistent volume annotations{}
resourcesCPU/Memory resource requests/limitsMemory: 128Mi, CPU: 100m

Specify each parameter using the --set key=value[,key=value] argument to helm install.

注意

  • persistentVolume.existingClaim支持多个已存在PVC的挂载,默认以PVC名为目录名,挂载在dev用户的/home/dev/upload下,在values.yaml中,请注意其uid和gid;

Persistence

The sftp image stores the data and configurations at the /home path of the container.

Deploy sftp with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has sftp on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsftp is pinned at v2.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply