0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2025-01-19 13:46:11 -05:00

feat(add Kubernetes Docs)

Signed-off-by: aushafy <aushafy@gmail.com>
This commit is contained in:
setyawanmuhammad 2024-02-27 14:14:06 +07:00
parent eacf693131
commit 6d4e805586
No known key found for this signature in database
GPG key ID: 916868674FA20BD2
2 changed files with 54 additions and 0 deletions

View file

@ -41,6 +41,24 @@ docker run -p 22:22 -d atmoz/sftp foo:pass:::upload
User "foo" with password "pass" can login with sftp and upload files to a folder called "upload". No mounted directories or custom UID/GID. Later you can inspect the files and use `--volumes-from` to mount them somewhere else (or see next example).
## Simplest kubernetes deployment example
```
kubectl apply -f https://raw.githubusercontent.com/aushafy/sftp/master/examples/kubernetes/simplest-deployment.yaml
```
Warning! do not apply this manifest to the production environment, this is only for testing! data written on to SFTP server would be erased during restart or rollout
### Testing SFTP Server on Kubernetes
```
kubectl port-forward svc/sftp-server 2222:22
```
then open another terminal and run
```
sftp -P 2222 foo@localhost
```
## Sharing a directory from your computer
Let's mount a directory and set UID:

View file

@ -0,0 +1,36 @@
# Warning!
# do not apply this manifest to the production environment, this is only for testing
# data written on to SFTP server would be erased during restart or rollout
apiVersion: apps/v1
kind: Deployment
metadata:
name: sftp-server
spec:
replicas: 1
selector:
matchLabels:
app: sftp-server
template:
metadata:
labels:
app: sftp-server
spec:
containers:
- name: sftp-server
image: atmoz/sftp:alpine
ports:
- containerPort: 22
args: ["foo:pass:::upload"]
---
apiVersion: v1
kind: Service
metadata:
name: sftp-server
spec:
selector:
app: sftp-server
ports:
- protocol: TCP
port: 22
targetPort: 22
type: ClusterIP