From 6d4e805586efc1903e76321c9cc5043cefb88b51 Mon Sep 17 00:00:00 2001 From: setyawanmuhammad Date: Tue, 27 Feb 2024 14:14:06 +0700 Subject: [PATCH] feat(add Kubernetes Docs) Signed-off-by: aushafy --- README.md | 18 ++++++++++ examples/kubernetes/simplest-deployment.yaml | 36 ++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 examples/kubernetes/simplest-deployment.yaml diff --git a/README.md b/README.md index 9f923b8..206c79f 100644 --- a/README.md +++ b/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: diff --git a/examples/kubernetes/simplest-deployment.yaml b/examples/kubernetes/simplest-deployment.yaml new file mode 100644 index 0000000..83a4878 --- /dev/null +++ b/examples/kubernetes/simplest-deployment.yaml @@ -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 \ No newline at end of file