Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions docs/developer-guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,41 +64,34 @@ helm install clickhouse clickhouse --repo https://helm.altinity.com \
<details>
<summary>Object Storage</summary>

Add the minio operator
Create a secret for RustFS credentials

```sh
helm install minio-operator operator \
--repo https://operator.min.io/ \
--set operator.env\[0\].name=WATCHED_NAMESPACE \
--set operator.env\[0\].value=currents \
--set operator.replicaCount=1
kubectl create secret generic currents-rustfs-user \
--from-literal=RUSTFS_ACCESS_KEY=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32) \
--from-literal=RUSTFS_SECRET_KEY=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32)
```

Create the root user config (edit the username/password in samples/minio-config.env)
Install RustFS

```sh
kubectl create secret generic currents-minio-env-configuration --from-file=config.env=samples/minio-config.env
helm install rustfs rustfs --repo https://charts.rustfs.com -f samples/rustfs-helm-config.yaml
```

Create the additional users for currents
Create the `currents` bucket

```sh
kubectl create secret generic currents-minio-user --from-literal=CONSOLE_ACCESS_KEY=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 32) --from-literal=CONSOLE_SECRET_KEY=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32)
kubectl apply -f samples/rustfs-create-bucket-job.yaml
kubectl wait --for=condition=complete job/rustfs-create-bucket --timeout=60s
```

Create a minio tenant instance
Create an ingress for RustFS

```sh
helm install tenant tenant --repo https://operator.min.io/ -f samples/minio-tenant-helm-config.yaml
kubectl apply -f samples/local/rustfs-ingress.yaml
```

Create an ingress for minio

```sh
kubectl apply -f samples/local/minio-ingress.yaml
```

Note that you will need to add `mino.localhost` to your `/etc/hosts` file on the loopback
Note that you will need to add `rustfs.localhost` to your `/etc/hosts` file on the loopback

</details>

Expand Down
179 changes: 103 additions & 76 deletions docs/eks/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,105 +119,93 @@ Follow this step if you plan to use provider (S3, Cloudflare) object storage (re

### Alternative Object Storage (in cluster)

Install Minio if you don't have access to an Object Storage provider (S3, Cloudflare). You will need an additional subdomain for Minio.
Install RustFS if you don't have access to an Object Storage provider (S3, Cloudflare). You will need an additional subdomain for RustFS.

Creates a single Pod instance of Minio with 10Gb of storage.
Creates a single Pod instance of RustFS with 10Gi of storage.

1. Add the minio operator
1. Create a secret for RustFS credentials
```sh
helm install minio-operator operator \
--repo https://operator.min.io/ \
--set operator.env\[0\].name=WATCHED_NAMESPACE \
--set operator.env\[0\].value=currents \
--set operator.replicaCount=1
kubectl create secret generic currents-rustfs-user \
--from-literal=RUSTFS_ACCESS_KEY=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32) \
--from-literal=RUSTFS_SECRET_KEY=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32)
```

2. Create the root user config environment
```sh
printf 'export MINIO_ROOT_USER="%s"\nexport MINIO_ROOT_PASSWORD="%s"\n' $(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | LC_ALL=C tr -dc 'a-zA-Z0-[B9' | head -c 32) $(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32) > minio-config.env
kubectl create secret generic currents-minio-env-configuration --from-file=config.env=minio-config.env
```

3. Create the additional users for currents
```sh
kubectl create secret generic currents-minio-user --from-literal=CONSOLE_ACCESS_KEY=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 32) --from-literal=CONSOLE_SECRET_KEY=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32)
```

4. Create a Minio Tenant Values file
2. Create a RustFS values file

`minio-tenant-helm-config.yaml`
`rustfs-helm-config.yaml`
```yaml
tenant:
name: currents-minio
configSecret:
name: currents-minio-env-configuration
existingSecret: true
accessKey: null
secretKey: null
pools:
- servers: 1
name: pool-0
volumesPerServer: 1
size: 10Gi
storageAnnotations: { }
storageLabels: { }
annotations: { }
labels: { }
tolerations: [ ]
nodeSelector: { }
affinity: { }
resources: { }
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
fsGroupChangePolicy: "OnRootMismatch"
runAsNonRoot: true
containerSecurityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
topologySpreadConstraints: [ ]
buckets:
- name: currents
users:
- name: currents-minio-user
# Standalone mode for dev/test - single pod
mode:
standalone:
enabled: true
distributed:
enabled: false

# Use the secret we created for credentials
secret:
existingSecret: "currents-rustfs-user"

# Service configuration
service:
type: ClusterIP
endpoint:
port: 9000
console:
port: 9001

# Disable gateway API / TraefikService CRD creation
gatewayApi:
gatewayClass: ""

# Disable built-in ingress (we create our own for full control)
ingress:
enabled: false

# Storage configuration
storageclass:
name: "" # Uses default storage class
dataStorageSize: "10Gi"
logStorageSize: "256Mi"

# Resource limits
resources:
limits:
cpu: "500m"
memory: "512Mi"
requests:
cpu: "100m"
memory: "128Mi"
```

5. Install the Minio Tenant Instance
3. Install RustFS
```sh
helm install minio-tenant tenant --repo https://operator.min.io/ -f minio-tenant-helm-config.yaml
helm install rustfs rustfs --repo https://charts.rustfs.com -f rustfs-helm-config.yaml
```

6. Create an Ingress Resource to expose the Minio S3 api
4. Create an Ingress Resource to expose the RustFS S3 API

Be sure to customize the following:
- `alb.ingress.kubernetes.io/certificate-arn`
- `spec.ingressClassName`
- `spec.rules.host`
- `spec.rules[0].host`

file: `minio-eks-ingress.yaml`
`rustfs-eks-ingress.yaml`
```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-minio
name: ingress-rustfs
annotations:
# Set to 'internet-facing' to expose to the public
alb.ingress.kubernetes.io/scheme: internal
alb.ingress.kubernetes.io/group.name: currents
# Set the ARN a resource managed by aws certificate manager, that matches the DNS host
# Set the ARN to a resource managed by AWS Certificate Manager
alb.ingress.kubernetes.io/certificate-arn: "arn:aws:acm:"
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/backend-protocol: HTTPS
alb.ingress.kubernetes.io/healthcheck-protocol: HTTPS
alb.ingress.kubernetes.io/success-codes: '200,403'
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-path: /health
alb.ingress.kubernetes.io/success-codes: '200'
spec:
ingressClassName: alb-currents
rules:
Expand All @@ -229,14 +217,53 @@ Creates a single Pod instance of Minio with 10Gb of storage.
pathType: Prefix
backend:
service:
name: minio
name: rustfs
port:
number: 443
number: 9000
```

```sh
kubectl apply -f rustfs-eks-ingress.yaml
```

5. Create the `currents` bucket by applying a Job that uses mc (MinIO client)

`rustfs-create-bucket-job.yaml`
```yaml
apiVersion: batch/v1
kind: Job
metadata:
name: rustfs-create-bucket
spec:
ttlSecondsAfterFinished: 300
template:
spec:
restartPolicy: Never
containers:
- name: mc
image: minio/mc:latest
env:
- name: RUSTFS_ACCESS_KEY
valueFrom:
secretKeyRef:
name: currents-rustfs-user
key: RUSTFS_ACCESS_KEY
- name: RUSTFS_SECRET_KEY
valueFrom:
secretKeyRef:
name: currents-rustfs-user
key: RUSTFS_SECRET_KEY
command:
- /bin/sh
- -c
- |
mc alias set rustfs http://rustfs:9000 $RUSTFS_ACCESS_KEY $RUSTFS_SECRET_KEY
mc mb --ignore-existing rustfs/currents
```

7. Apply the Ingress file
```sh
kubectl apply -f minio-eks-ingress.yaml
kubectl apply -f rustfs-create-bucket-job.yaml
kubectl wait --for=condition=complete job/rustfs-create-bucket --timeout=60s
```

### SMTP Email
Expand Down
16 changes: 8 additions & 8 deletions docs/eks/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Quickstart: Installing Currents on EKS

The QuickStart for installing the Currents Helm Chart on EKS runs through the commands to get the Currents App setup. This includes installing dependencies like MongoDB, Elasticsearch, and Minio into your Kubernetes namespace.
The QuickStart for installing the Currents Helm Chart on EKS runs through the commands to get the Currents App setup. This includes installing dependencies like MongoDB, ClickHouse, and RustFS into your Kubernetes namespace.

## Accessing Currents Docker Images

Expand Down Expand Up @@ -104,14 +104,14 @@ Configure and install the Currents Helm Chart once all the services are ready.
# NOTE: Choose either IAM (remove secretName) OR secret-based authentication.
# Do NOT leave secretName in your configuration if you haven't created the secret.

# Option 3: For minio deployed in the same K8s namespace
# Use the following settings instead if you setup Minio
# secretName: currents-minio-user
# secretIdKey: CONSOLE_ACCESS_KEY
# secretAccessKey: CONSOLE_SECRET_KEY
# Set the endpoint to your Minio Route
# Option 3: For RustFS deployed in the same K8s namespace
# Use the following settings instead if you setup RustFS
# secretName: currents-rustfs-user
# secretIdKey: RUSTFS_ACCESS_KEY
# secretAccessKey: RUSTFS_SECRET_KEY
# Set the endpoint to your RustFS route
# endpoint: https://storage.eks.example.com
# internalEndpoint: https://minio
# internalEndpoint: http://rustfs
# bucket: currents
# pathStyle: true

Expand Down
8 changes: 4 additions & 4 deletions samples/eks/eks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ currents:
host: clickhouse-clickhouse
objectStorage:
endpoint: https://storage.eks.currents-sandbox.work
internalEndpoint: https://minio
secretName: currents-minio-user
secretIdKey: CONSOLE_ACCESS_KEY
secretAccessKey: CONSOLE_SECRET_KEY
internalEndpoint: http://rustfs
secretName: currents-rustfs-user
secretIdKey: RUSTFS_ACCESS_KEY
secretAccessKey: RUSTFS_SECRET_KEY
bucket: currents
pathStyle: true

Expand Down
25 changes: 0 additions & 25 deletions samples/eks/minio-eks-ingress.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions samples/eks/rustfs-eks-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-rustfs
annotations:
# Set to 'internet-facing' to expose to the public
alb.ingress.kubernetes.io/scheme: internal
alb.ingress.kubernetes.io/group.name: currents
# Set the ARN to a resource managed by AWS Certificate Manager
alb.ingress.kubernetes.io/certificate-arn: "arn:aws:acm:"
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-path: /health
alb.ingress.kubernetes.io/success-codes: '200'
spec:
ingressClassName: alb-currents
rules:
# Set the storage DNS name
- host: storage.eks.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: rustfs
port:
number: 9000
10 changes: 5 additions & 5 deletions samples/local/chart-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ currents:
enabled: false
host: clickhouse-clickhouse
objectStorage:
endpoint: http://minio.localhost
internalEndpoint: https://minio
secretName: currents-minio-user
secretIdKey: CONSOLE_ACCESS_KEY
secretAccessKey: CONSOLE_SECRET_KEY
endpoint: http://rustfs.localhost
internalEndpoint: http://rustfs
secretName: currents-rustfs-user
secretIdKey: RUSTFS_ACCESS_KEY
secretAccessKey: RUSTFS_SECRET_KEY
bucket: currents
pathStyle: true

Expand Down
Loading