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:
parent
eacf693131
commit
6d4e805586
2 changed files with 54 additions and 0 deletions
18
README.md
18
README.md
|
@ -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:
|
||||
|
|
36
examples/kubernetes/simplest-deployment.yaml
Normal file
36
examples/kubernetes/simplest-deployment.yaml
Normal 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
|
Loading…
Add table
Reference in a new issue