fl proxy
When running in “proxy” mode, the fl tool or flexifyio/proxy Docker image accepts S3 requests and re-directs them to one or more clouds/storages, possibly via different API, such as Azure Blob API.
Install on Linux (DEB and RPM), then run fl proxy --help to display the list of proxy options.
Options
fl proxy [OPTION]...
Additional options are located in this page: Common options
Command line option | Environment variable / | Config file option | Description |
|
| - | [optional] Path to the proxy configuration file. If defined, all command line and environment variables for options that can be defined in the configuration file will be ignored. See Using configuration file with fl proxy for details. |
|
|
| [optional] HMAC Access Key ID and Secret Key for this endpoint. Proxy’s S3 clients need to use those keys to authenticate requests. If not specified, key will be generated and displayed automatically. |
- | - |
| [optional] Must be set to |
|
|
| [optional] Proxy’s S3 endpoint DNS hostname that S3 clients will use. It is required to use virtual-style bucket addressing. If not specified, only path-style bucket addressing can be used. |
|
|
| [optional] Storage selection policy for GET/HEAD object requests ( Default is |
|
|
| [optional] Defines if an object should be deleted from a cloud it is not written to when it’s written to other clouds ( Default is |
|
|
| [optional, experimental] A minimum number of clouds that return success for “put” operations before the success if returned to the proxy’s S3 client. Default is 0, meaning “all storages”. |
|
|
| [optional] Timeout before breaking connection with non-responding clouds when the |
|
|
| [optional] A secret key to use when encrypting SSE-C key encoded as part of Azure's multipart upload ID. Required to use multipart upload in Azure with SSE-C. The value can be generated with |
|
|
| [required if Cloud provider code. See Most commonly used: Full list of supported providers and their codes can be found in |
|
|
| [required if HMAC Access Key ID or Azure Storage account name to use when sending requests to that cloud. |
|
|
| HMAC Secret Access Key or Azure Storage Account key to use when sending requests to that cloud. |
|
|
| Azure SAS signature (can be used instead of Azure Storage Account key). |
|
|
| [optional] AWS STS session token if temporary AWS credentials are used. Only for S3. |
|
|
| [optional] Custom endpoint to use when connecting to that cloud. |
|
|
| [optional] Region of a multi-regional provider to use for multi-bucket requests such as |
|
|
| Defines if unencrypted HTTP or encrypted HTTPS when connecting to that cloud. |
|
|
| Force path-style bucket addressing in requests to that cloud. |
- | - |
| [optional] Escape sequence to replace dots ( Default: none/disabled |
|
|
| Do not store/write new data to that cloud. |
|
|
| Do not delete data from that cloud. |
|
|
| [optional] Region to create new buckets in. |
|
|
| [required if Name of a virtual bucket. |
|
|
| [optional] Code code of a cloud provider that will be attached to the virtual bucket. |
|
|
| [required if HMAC Access Key ID or Azure Storage account name of corresponding virtual bucket attachment. |
|
|
| [required if HMAC Secret Access Key, Azure Storage account key or Azure SAS signature of corresponding virtual bucket attachment. |
|
|
| [optional] AWS STS session token if temporary AWS credentials are used. Only for S3. |
|
|
| [required if Name of the attached bucket/container at the storage provider. |
|
|
| [optional] Custom endpoint to use when connecting to corresponding storage provider. |
|
|
| [optional] Region to be used in AWS v4 signature for requests to corresponding bucket at the storage provider. |
|
|
| Defines if unencrypted HTTP or encrypted HTTPS is used when connecting to the corresponding storage provider. |
|
|
| Force path-style bucket addressing in requests to corresponding storage provider. |
- | - |
| [optional] Escape sequence to replace dots ( Default: none/disabled |
|
|
| Do not store/write new data to the corresponding storage provider when data is written to the virtual bucket. |
|
|
| Do not delete data from the corresponding storage provider when data is deleted from the virtual bucket. |
|
| - | [optional] Port for incoming S3 connections over HTTP. 0 disables undecrypted S3 connection over HTTP. Default is 80. |
|
| - | [optional] If Default is 443. |
|
| - | [optional] Endpoint’s SSL certificate (full chain) and private key in PEM format. HTTPS will be disabled if not specified. |
|
| - | [optional] Maximum number of simultaneous incoming connections from S3 client accepted by proxy. Default: unlimited. |
|
| - | [optional] Client (incoming) TCP connection idle timeout (in seconds). If no data is sent or received via a connection for the specified duration the connection is closed. Default is 300 seconds. |
|
| - | [optional] Cloud (outgoing) TCP connection idle timeout (in seconds). If no data is sent to or receives via a connection for the specified duration, the connection is closed. Default is 300 seconds. |
|
| - | Report level for proxy reports. One of |
Examples
S3-Azure Gateway
This will start S3-Azure gateway proxying S3 requests to Azure Blob Storage.
fl proxy \
--cloud AZURE \
--cloud-key-id <storage account name> \
--cloud-secret-key <storage account key>
or
docker run -p 80:80 -p 443:443 flexifyio/proxy \
--cloud AZURE \
--cloud-key-id <storage account name> \
--cloud-secret-key <storage account key>
Multiple providers
This command will start proxy with Azure and AWS attached. It will combine containers/buckets and objects from all attached providers, and replicate newly written data to both providers.
fl proxy \
--cloud1 AZURE \
--cloud1-key-id <storage account name> \
--cloud1-secret-key <storage account key> \
--cloud2 AWS \
--cloud2-key-id <access key> \
--cloud2-secret-key <secret key>
Now you can connect to the proxy at port 80 with any S3-compatible application.
Combining Azure containers
Virtual buckets allow re-mapping bucket or container names or combining contents of multiple buckets/containers under the same bucket name.
fl proxy \
--virtual-bucket1 combined-bucket \
--virtual-bucket1-cloud1 AZURE \
--virtual-bucket1-cloud1-key-id <storage account name> \
--virtual-bucket1-cloud1-secret-key <storage account key> \
--virtual-bucket1-cloud1-bucket container1 \
--virtual-bucket1-cloud2 AZURE \
--virtual-bucket1-cloud2-key-id <storage account name> \
--virtual-bucket1-cloud2-secret-key <storage account key> \
--virtual-bucket1-cloud2-bucket container2
virtual-bucket1-cloud1 and virtual-bucket1-cloud2 providers and accounts can be same or different. You can configure up to eight virtual buckets and attach up to eight provider buckets to each of them.
Docker Compose
Example of Docker Compose file that starts proxy as S3-Azure gateway:
services:
engine:
image: flexifyio/proxy
ports:
- 80:80
volumes:
- $PWD/logs:/var/log/flexify/engine/
- $PWD/reports:/var/lib/flexify/engine/proxy_reports/
environment:
FLEXIFY_ENGINE_KEY_ID: FlIOBSxrQ8IqP3hkXPdWiF0Z
FLEXIFY_ENGINE_SECRET_KEY: <S3 secret key>
FLEXIFY_ENGINE_CLOUD: AZURE
FLEXIFY_ENGINE_CLOUD_KEY_ID: flexifyeastus
FLEXIFY_ENGINE_CLOUD_SECRET_KEY: <Azure account key>
FLEXIFY_ENGINE_PORT: 80
FLEXIFY_ENGINE_LOG_LEVEL: INFO
restart: unless-stopped
Docker Compose with multiple virtual buckets
Example of Docker Compose file that starts proxy as S3-Azure gateway combining data from two containers and writing changed only to the first container while second container is effectively read-only.
services:
engine:
image: flexifyio/proxy
ports:
- 80:80
volumes:
- logs:/var/log/flexify/engine/
- reports:/var/lib/flexify/engine/proxy_reports/
environment:
# S3 frontend
FLEXIFY_ENGINE_KEY_ID: FlIOBSxrQ8IqP3hkXPdWiF0Z
FLEXIFY_ENGINE_SECRET_KEY: <S3 secret key>
FLEXIFY_ENGINE_VIRTUAL_BUCKET: combined-bucket
# 1st Azure container
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD1: AZURE
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD1_KEY_ID: <Azoure account name>
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD1_SECRET_KEY: <Azure account key>
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD1_BUCKET: container1
# 2nd Azure container
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2: AZURE
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_KEY_ID: <Azoure account name>
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_SECRET_KEY: <Azure account key>
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_BUCKET: container2
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_NOPUT: true
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_NODELETE: true
restart: unless-stopped
Docker Compose with SSL
To enable TLS/SSL, specify SSL certificate and private key in PEM format (not the path to a file).
services:
engine:
image: flexifyio/proxy:latest
ports:
- 80:80
- 443:443
volumes:
- logs:/var/log/flexify/engine/
- reports:/var/lib/flexify/engine/proxy_reports/
environment:
FLEXIFY_ENGINE_KEY_ID: FlIOBSxrQ8IqP3hkXPdWiF0Z
FLEXIFY_ENGINE_SECRET_KEY: <S3 secret key>
FLEXIFY_ENGINE_CLOUD: AZURE
FLEXIFY_ENGINE_CLOUD_KEY_ID: flexifyeastus
FLEXIFY_ENGINE_CLOUD_SECRET_KEY: <key>
FLEXIFY_ENGINE_PORT: 80
FLEXIFY_ENGINE_SSL_PORT: 443
FLEXIFY_ENGINE_ENDPOINT: s3.example.com
FLEXIFY_ENGINE_SSL_CERT: |
-----BEGIN CERTIFICATE-----
MIIFCDCCA/CgAwIBA.....
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFFjCCAv6gAwIBAg....
-----END CERTIFICATE-----
FLEXIFY_ENGINE_SSL_KEY: |
-----BEGIN PRIVATE KEY-----
MIIEugIBADANBgkq.....
-----END PRIVATE KEY-----
FLEXIFY_ENGINE_LOG_LEVEL: INFO
restart: unless-stopped
Kubernetes with SSL
Here is an example of running S3-Azure proxy on Kubernetes such as AKS:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: flexify-log-claim
namespace: flexify
spec:
accessModes:
- ReadWriteOnce
storageClassName: default
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: flexify-deployment
namespace: flexify
spec:
replicas: 3
selector:
matchLabels:
app: flexify
template:
metadata:
labels:
app: flexify
spec:
containers:
- name: flexify
image: flexifyio/proxy:latest
ports:
- containerPort: 80
- containerPort: 443
env:
- name: FLEXIFY_ENGINE_KEY_ID
value: "FlIOBSxrQ8IqP3hkXPdWiF0Z"
- name: FLEXIFY_ENGINE_SECRET_KEY
value: "<secret>"
- name: FLEXIFY_ENGINE_CLOUD
value: "AZURE"
- name: FLEXIFY_ENGINE_CLOUD_KEY_ID
value: "fleastus"
- name: FLEXIFY_ENGINE_CLOUD_SECRET_KEY
value: "<secret>"
- name: FLEXIFY_ENGINE_PORT
value: "80"
- name: FLEXIFY_ENGINE_SSL_PORT
value: "443"
- name: FLEXIFY_ENGINE_ENDPOINT
value: "s3.example.com"
- name: FLEXIFY_ENGINE_LOG_LEVEL
value: "INFO"
- name: FLEXIFY_ENGINE_SSL_CERT
value: |
-----BEGIN CERTIFICATE-----
xxxxx
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
xxxxx
-----END CERTIFICATE-----
- name: FLEXIFY_ENGINE_SSL_KEY
value: |
-----BEGIN PRIVATE KEY-----
xxxx
-----END PRIVATE KEY-----
volumeMounts:
- mountPath: /var/log/flexify/engine/
name: flexify-log
volumes:
- name: flexify-log
persistentVolumeClaim:
claimName: flexify-log-claim
---
apiVersion: v1
kind: Service
metadata:
name: flexify-service
namespace: flexify
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
type: LoadBalancer
ports:
- port: 443
targetPort: 443
selector:
app: flexify