Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): add kubernetes example deployment on readme.md #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
36 changes: 36 additions & 0 deletions examples/kubernetes/simplest-deployment.yaml
Original file line number Diff line number Diff line change
@@ -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