From 21b585689d452d67860a3450685f8cd14a4e9e42 Mon Sep 17 00:00:00 2001 From: beyondszine Date: Sat, 17 Aug 2019 19:13:38 +0530 Subject: [PATCH] updated README for kubernetes n helm chart --- README.md | 17 +++++++++++++++-- charts/transfersh/templates/deployment.yaml | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 904f44d..ae0f044 100644 --- a/README.md +++ b/README.md @@ -207,15 +207,28 @@ Pass the params to the transfer.sh binary inside container by the *args*, not th ```bash docker run -p 8080:8080 dutchcoders/transfer.sh:latest --provider s3 --http-auth-user my-username --http-auth-pass somepassword --aws-access-key $AWS_ACCESS_KEY_ID --aws-secret-key $AWS_SECRET_ACCESS_KEY --bucket $AWS_TRANSFERSH_BUCKET --s3-region $AWS_TRANSFERSH_BUCKET_REGION +``` +## Kubernetes helm chart +```sh # Kubernetes examples: # run locally -kubectl run transfersh --restart=Never --image=dutchcoders/transfer.sh:latest -- --http-auth-user my-username --http-auth-pass somepassword --provider local --basedir=/tmp +kubectl run transfersh --restart=Never --image=dutchcoders/transfer.sh:latest -- --http-auth-user my-username --http-auth-pass somepassword --provider local --basedir=/tmp # run with s3 -kubectl run transfersh --restart=Never --image=dutchcoders/transfer.sh:latest -- --http-auth-user my-username --http-auth-pass somepassword --provider s3 --basedir=/tmp--aws-access-key $AWS_ACCESS_KEY_ID --aws-secret-key $AWS_SECRET_ACCESS_KEY --bucket $AWS_TRANSFERSH_BUCKET --s3-region $AWS_TRANSFERSH_BUCKET_REGION +kubectl run transfersh --restart=Never --image=dutchcoders/transfer.sh:latest -- --http-auth-user my-username --http-auth-pass somepassword --provider s3 --aws-access-key $AWS_ACCESS_KEY_ID --aws-secret-key $AWS_SECRET_ACCESS_KEY --bucket $AWS_TRANSFERSH_BUCKET --s3-region $AWS_TRANSFERSH_BUCKET_REGION +# Helm chart deployment +# defaults to s3 provider, to change, goto `args` in deployment.yaml +# if your service is going to run behind nginx or any other proxy then update, proxy-path variable too in deployment.yaml, by-default it is blank. + +# create secret for deployment params +kubectl create secret generic transfersh-secrets --from-literal=HTTP_AUTH_USER=$HTTP_AUTH_USER --from-literal=HTTP_AUTH_PASS=$HTTP_AUTH_PASS --from-literal=AWS_ACCESS_KEY=$AWS_ACCESS_KEY --from-literal=AWS_SECRET_KEY=$AWS_SECRET_KEY --from-literal=AWS_BUCKET_NAME=$AWS_BUCKET_NAME --from-literal=AWS_BUCKET_REGION=$AWS_BUCKET_REGION + +cd charts/transfersh +helm install --debug --name=transfersh transfersh/ + ``` diff --git a/charts/transfersh/templates/deployment.yaml b/charts/transfersh/templates/deployment.yaml index 4bb20b6..acc6b95 100644 --- a/charts/transfersh/templates/deployment.yaml +++ b/charts/transfersh/templates/deployment.yaml @@ -54,7 +54,7 @@ spec: secretKeyRef: name: transfersh-secrets key: AWS_BUCKET_REGION - args: ["--http-auth-user","$(HTTP_AUTH_USER)","--http-auth-pass","$(HTTP_AUTH_PASS)","--provider","s3","--aws-access-key","$(AWS_ACCESS_KEY)","--aws-secret-key","$(AWS_SECRET_KEY)","--bucket","$(AWS_BUCKET_NAME)","--s3-region","$(AWS_BUCKET_REGION)","--proxy-path","filemanager"] + args: ["--http-auth-user","$(HTTP_AUTH_USER)","--http-auth-pass","$(HTTP_AUTH_PASS)","--provider","s3","--aws-access-key","$(AWS_ACCESS_KEY)","--aws-secret-key","$(AWS_SECRET_KEY)","--bucket","$(AWS_BUCKET_NAME)","--s3-region","$(AWS_BUCKET_REGION)","--proxy-path",""] livenessProbe: httpGet: path: /