Skip to content
Merged
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
78 changes: 22 additions & 56 deletions docs/eks/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Currents depends on several third-party services that are not bundled with the Helm chart. You are responsible for allocating resources, installing, and maintaining these services. During the installation process, you’ll need to provide credentials so Currents can configure these services as needed.

We provide a quick reference of how to create those services for your convenience. The documented configuration for the connected stateful services (mongo, elastic) are not definitive, and may not be adequate for all production setups.
We provide a quick reference of how to create those services for your convenience. The documented configuration for the connected stateful services (mongo, clickhouse) are not definitive, and may not be adequate for all production setups.

### MongoDB

Expand Down Expand Up @@ -66,72 +66,38 @@ This will setup a 2-node Mongo Cluster, with each being 10Gb available for stora
```


### Elasticsearch
### ClickHouse

Advanced options are available at:
(docs: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html )
For ClickHouse there are several production support options:

This will setup a 1-node Elasticsearch cluster, requireing 2Gb of memory and using 5Gb of storage.
- Sass Cloud instances (Via [ClickHouse Cloud](https://clickhouse.com/cloud) or [Altinity Cloud](https://docs.altinity.com/altinitycloud/))
- Bring your own Cloud ([install ClickHouse Cloud in your AWS](https://clickhouse.com/docs/cloud/reference/byoc/overview))
- On-Premises Kubernetes Deployments ([ClickHouse Private](https://clickhouse.com/docs/cloud/infrastructure/clickhouse-private) or [Altinity Operator](https://docs.altinity.com/altinitykubernetesoperator/))

1. Install the Elasticsearch Operator
```sh
helm install elastic-operator-crds eck-operator-crds --repo https://helm.elastic.co
helm install elastic-operator eck-operator \
--repo https://helm.elastic.co \
--set=installCRDs=false \
--set=managedNamespaces='{currents}' \
--set=createClusterScopedResources=false \
--set=webhook.enabled=false \
--set=config.validateStorageClass=false
```
For this guide we are going to install the open-source [Altinity Kubernetes Operator for ClickHouse](https://docs.altinity.com/altinitykubernetesoperator/)

2. Create the Elasticsearch Resources file to apply.
Advanced configuration available at:
(docs: https://github.com/Altinity/helm-charts/blob/main/charts/clickhouse/README.md )

`elasticsearch.yaml`
```yaml
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
spec:
version: 8.17.3
volumeClaimDeletePolicy: DeleteOnScaledownOnly
nodeSets:
- name: default
count: 1
config:
node.store.allow_mmap: false
volumeClaimTemplates:
- metadata:
name: elasticsearch-data # Do not change this name unless you set up a volume mount for the data path.
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
http:
tls:
selfSignedCertificate:
disabled: true
```
This will setup a 1-node 1-shard ClickHouse Replicated Server (10Gb Storage)

4. Apply the Elasticsearch Resource

1. Create Secrets for the ClickHouse Users
```sh
kubectl apply -f elasticsearch.yaml
kubectl create secret generic clickhouse-default-pass --from-literal=password=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32)
kubectl create secret generic clickhouse-currents-pass --from-literal=password=$(head -c 512 /dev/urandom | LC_ALL=C tr -cd 'a-zA-Z0-9' | head -c 32)
```

5. Wait for the Elasticsearch pod to be available, then generate an api key:
<!-- {% raw %} -->
2. Install the Altinity Kubernetes Operator
```sh
PASSWORD=$(kubectl get secret elasticsearch-es-elastic-user -o go-template='{{.data.elastic | base64decode}}')
kubectl exec elasticsearch-es-default-0 -- curl -u "elastic:$PASSWORD" -X POST -H "Content-Type: application/json" -d "{ \"name\": \"currents-key\" }" "http://elasticsearch-es-http:9200/_security/api_key" > es-api.key.json
helm install clickhouse-operator altinity-clickhouse-operator --repo https://docs.altinity.com/clickhouse-operator
```
<!-- {% endraw %} -->

6. Create a new secret with the api info from the key we just created (requires jq installed locally)
3. Install the Altinity Kubernetes Operator
```sh
kubectl create secret generic currents-es-api-key --from-literal=apiId=$(jq -r .id es-api.key.json) --from-literal=apiKey=$(jq -r .api_key es-api.key.json)
helm install clickhouse clickhouse --repo https://helm.altinity.com \
--set=clickhouse.defaultUser.password_secret_name=clickhouse-default-pass \
--set-json='clickhouse.users=[{"name":"currents","password_secret_name":"clickhouse-currents-pass"}]' \
--set operator.enabled=false
```

### Object Storage (provider)
Expand Down Expand Up @@ -160,7 +126,7 @@ Creates a single Pod instance of Minio with 10Gb of storage.
1. Add the minio operator
```sh
helm install minio-operator operator \
--repo https://operator.min.io/
--repo https://operator.min.io/ \
--set operator.env\[0\].name=WATCHED_NAMESPACE \
--set operator.env\[0\].value=currents \
--set operator.replicaCount=1
Expand Down
12 changes: 5 additions & 7 deletions docs/eks/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,13 @@ Configure and install the Currents Helm Chart once all the services are ready.
mongoConnection:
secretName: mongodb-currents-currents-user
key: connectionString.standardSrv
elastic:
clickhouse:
user:
secretName: clickhouse-currents-pass
secretPasswordKey: password
tls:
enabled: false
host: elasticsearch-es-http
admin:
secretName: elasticsearch-es-elastic-user
secretKey: elastic
apiUser:
secretName: currents-es-api-key
host: clickhouse-clickhouse

director:
ingress:
Expand Down
12 changes: 5 additions & 7 deletions samples/eks/eks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ currents:
secretName: mongodb-currents-currents-user
key: connectionString.standardSrv
imageTag: staging
elastic:
clickhouse:
user:
secretName: clickhouse-currents-pass
secretPasswordKey: password
tls:
enabled: false
host: elasticsearch-es-http
admin:
secretName: elasticsearch-es-elastic-user
secretKey: elastic
apiUser:
secretName: currents-es-api-key
host: clickhouse-clickhouse
objectStorage:
endpoint: https://storage.eks.currents-sandbox.work
internalEndpoint: https://minio
Expand Down
16 changes: 0 additions & 16 deletions samples/elasticsearch.yml

This file was deleted.