Skip to content

Commit

Permalink
Add filestash as example
Browse files Browse the repository at this point in the history
  • Loading branch information
derpsteb committed Oct 6, 2023
1 parent 07c2e2b commit 39f531e
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
69 changes: 69 additions & 0 deletions docs/docs/getting-started/examples/filstash-s3proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

# Deploying Filestash

Filestash is a web frontend for different storage backends, including S3.
It is a useful application to showcase s3proxy in action.

1. Deploy s3proxy as described in [Deployment](../../workflows/s3proxy.md#deployment).
2. Create a deployment file for Filestash with one pod:

```sh
cat << EOF > "deployment-filestash.yaml"
apiVersion: apps/v1
kind: Deployment
metadata:
name: filestash
spec:
replicas: 1
selector:
matchLabels:
app: filestash
template:
metadata:
labels:
app: filestash
spec:
imagePullSecrets:
- name: regcred
hostAliases:
- ip: $(kubectl get svc s3proxy-service -o=jsonpath='{.spec.clusterIP}')
hostnames:
- "s3.eu-west-1.amazonaws.com"
containers:
- name: filestash
image: machines/filestash:latest
ports:
- containerPort: 8334
volumeMounts:
- name: ca-cert
mountPath: /etc/ssl/certs/kube-ca.crt
subPath: kube-ca.crt
volumes:
- name: ca-cert
secret:
secretName: s3proxy-tls
items:
- key: ca.crt
path: kube-ca.crt
EOF
```

The pod spec includes the `hostAliases` key, which adds an entry to the pod's `/etc/hosts`.
The entry forwards all requests for `s3.eu-west-1.amazonaws.com` to the kubernetes service `s3proxy-service`.
If you followed the s3proxy [Deployment](../../workflows/s3proxy.md#deployment) guide, this service points to a s3proxy pod.

To use other regions than `eu-west-1`, add more entries to `hostAliases` for all regions you require.
Use the same IP for those entries. For example to add `us-east-1` add:
```yaml
- ip: $(kubectl get svc s3proxy-service -o=jsonpath='{.spec.clusterIP}')
hostnames:
- "s3.us-east-1.amazonaws.com"
```
The spec also includes a volume mount for the TLS certificate and adds it to the pod's truststore.
Not doing this will result in TLS authentication errors.
3. Apply the file: `kubectl apply -f deployment-filestash.yaml`

Afterwards you can use a port forward to access the Filestash pod:
`kubectl port-forward pod/$(kubectl get pod --selector='app=filestash' -o=jsonpath='{.items[*].metadata.name}') 8443:8443`
3 changes: 1 addition & 2 deletions docs/docs/workflows/s3proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ If you want to use s3proxy but these limitations stop you from doing so, please
- `kubectl apply -f deployment-s3proxy.yaml`

s3proxy is now deployed.
If you want to run a demo application you can checkout the [Deploy Filestash](https://github.com/edgelesssys/constellation/tree/main/s3proxy/deploy#deploying-filestash) instructions to deploy Filestash.
Filestash is a web frontend for different storage backends, including S3.
If you want to run a demo application, checkout the [Filestash with s3proxy](../getting-started/examples/filstash-s3proxy.md) example.


## Technical details
Expand Down
5 changes: 5 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ const sidebars = {
label: 'Horizontal Pod Autoscaling',
id: 'getting-started/examples/horizontal-scaling'
},
{
type: 'doc',
label: 'Filestash with s3proxy',
id: 'getting-started/examples/filstash-s3proxy'
},
]
},
],
Expand Down

0 comments on commit 39f531e

Please sign in to comment.