-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters