Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
s8sg authored May 24, 2020
1 parent 577f08c commit eaccf31
Showing 1 changed file with 12 additions and 47 deletions.
59 changes: 12 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,23 @@
A **[faasflow](https://github.com/s8sg/faasflow)** datastore implementation that uses minio DB to store data
which can also be used with s3 bucket

## Getting Stated

### Deploy Minio
* Generate secrets for Minio
```bash
SECRET_KEY=$(head -c 12 /dev/urandom | shasum| cut -d' ' -f1)
ACCESS_KEY=$(head -c 12 /dev/urandom | shasum| cut -d' ' -f1)
```
#### Deploy in Kubernets
* Store the secrets in Kubernetes
```bash
kubectl create secret generic -n openfaas-fn \
s3-secret-key --from-literal s3-secret-key="$SECRET_KEY"
kubectl create secret generic -n openfaas-fn \
s3-access-key --from-literal s3-access-key="$ACCESS_KEY"
```
* Install Minio with helm
```bash
helm install --name cloud --namespace openfaas \
--set accessKey=$ACCESS_KEY,secretKey=$SECRET_KEY,replicas=1,persistence.enabled=false,service.port=9000,service.type=NodePort \
stable/minio
```
The name value should be `cloud-minio.openfaas.svc.cluster.local`

Enter the value of the DNS above into `s3_url` in `gateway_config.yml` adding the port at the end: `cloud-minio-svc.openfaas.svc.cluster.local:9000`

#### Deploy in Swarm
* Store the secrets
```bash
echo -n "$SECRET_KEY" | docker secret create s3-secret-key -
echo -n "$ACCESS_KEY" | docker secret create s3-access-key -
```
* Deploy Minio
```bash
docker service rm minio

docker service create --constraint="node.role==manager" \
--name minio \
--detach=true --network func_functions \
--secret s3-access-key \
--secret s3-secret-key \
--env MINIO_SECRET_KEY_FILE=s3-secret-key \
--env MINIO_ACCESS_KEY_FILE=s3-access-key \
minio/minio:latest server /export
## Minio Data-Store Configuration
Minio data-store needs the below configuration in the `flow.yml`
```yaml
s3_url
s3_region
s3_tls
s3_secret_key_name
s3_access_key_name
```
> Note: For debugging and testing. You can expose the port of Minio with docker service update minio --publish-add 9000:9000, but this is not recommended on the public internet.

### Use Minio dataStore in `faasflow`
## Use Minio dataStore in `faasflow`
* Set the `stack.yml` with the necessary environments
```yaml
s3_url: "minio:9000"
s3_url: "minio.faasflow:9000"
s3_tls: false
s3_secret_key_name: "s3-secret-key"
s3_access_key_name: "s3-access-key"
secrets:
- s3-secret-key
- s3-access-key
Expand Down

0 comments on commit eaccf31

Please sign in to comment.