Skip to content
Open
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
44 changes: 44 additions & 0 deletions deployment/docker/compose-cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: "3.8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need additional docker-compose files for helm charts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just sample of docker-compose files for local deployment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe @dkharms meant, that we already have docker-compose files in quickstart/ directory

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's what I meant. We already have all necessary docker-compose files for quickstart in quickstart/ directory.


services:
seq-db-proxy:
image: ghcr.io/ozontech/seq-db:latest
ports:
- "9002:9002" # Default HTTP port
- "9004:9004" # Default gRPC port
- "9200:9200" # Default debug port
command: --mode=proxy
--config=/configs/config.yaml
depends_on:
- seq-db-store
volumes:
- ./config-cluster.yaml:/configs/config.yaml
- ./mappings.yaml:/configs/mappings.yaml
seq-db-store:
image: ghcr.io/ozontech/seq-db:latest
command: --mode=store
--config=/configs/config.yaml
volumes:
- ./config-cluster.yaml:/configs/config.yaml
- ./mappings.yaml:/configs/mappings.yaml
- seqdbdata:/data
stdin_open: true
tty: true
restart: unless-stopped
seq-ui:
image: ghcr.io/ozontech/seq-ui:latest
volumes:
- ./config.seq-ui.yaml:/seq-ui/config.yaml
ports:
- "5555:5555" # Default HTTP port
- "5556:5556" # Default gRPC port
- "5557:5557" # Default debug port
command: --config config.yaml
seq-ui-fe:
image: ghcr.io/ozontech/seq-ui-fe:latest
ports:
- "5173:80"
volumes:
- ./seq-ui-fe-config.json:/usr/share/nginx/html/config.json
volumes:
seqdbdata: {}
19 changes: 19 additions & 0 deletions deployment/docker/compose-single.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3.8"

services:
seq-db:
image: ghcr.io/ozontech/seq-db:latest
ports:
- "9002:9002" # Default HTTP port
- "9004:9004" # Default gRPC port
- "9200:9200" # Default debug port
command: --config=/configs/config.yaml
--mode=single
volumes:
- ./config-single.yaml:/configs/config.yaml:ro
- seqdbdata:/data
stdin_open: true
tty: true
restart: unless-stopped
volumes:
seqdbdata: {}
25 changes: 25 additions & 0 deletions deployment/docker/config-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
storage:
data_dir: /data
frac_size: 256MiB
total_size: 100GiB

cluster:
hot_replicas: 1
# shuffle_replicas: true
hot_stores:
- seq-db-store:9004
# colds
# read_stores:
# - seq-db-store:9004
# write_stores:
# - seq-db-store:9004

mapping:
enable_updates: true
path: /configs/mappings.yaml
update_period: 5s

slow_logs:
bulk_threshold: 100ms
search_threshold: 20ms
fetch_threshold: 20ms
5 changes: 5 additions & 0 deletions deployment/docker/config-single.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
storage:
data_dir: /data

mapping:
path: auto
37 changes: 37 additions & 0 deletions deployment/docker/config.seq-ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
server:
http_addr: "0.0.0.0:5555"
grpc_addr: "0.0.0.0:5556"
debug_addr: "0.0.0.0:5557"
cors:
allowed_headers:
- Content-Type
- Authorization
allowed_methods:
- HEAD
- GET
- POST
- PATCH
- DELETE
allowed_origins:
- "*"
max_age: 300
clients:
seq_db_addrs:
- "seq-db-proxy:9004"
seq_db_timeout: 15s
seq_db_avg_doc_size: 100
request_retries: 3
proxy_client_mode: "grpc"
grpc_keepalive_params:
time: 10s
timeout: 10s
permit_without_stream: true
handlers:
seq_api:
seq_cli_max_search_limit: 10000
max_search_limit: 1000
max_search_total_limit: 100000
max_search_offset_limit: 100000
max_export_limit: 10000
max_parallel_export_requests: 1
max_aggregations_per_request: 3
17 changes: 17 additions & 0 deletions deployment/docker/mappings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mapping-list:
- type: "keyword"
name: "k8s_pod"
- type: "keyword"
name: "k8s_namespace"
- type: "keyword"
name: "k8s_container"
- type: "text"
name: "request"
- type: "path"
name: "request_uri"
- name: "message"
types:
- type: "text"
- title: "keyword"
type: "keyword"
size: 18
3 changes: 3 additions & 0 deletions deployment/docker/seq-ui-fe-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"SEQ_UI_URL": "http://localhost:5555/"
}
23 changes: 23 additions & 0 deletions deployment/k8s/helm-chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions deployment/k8s/helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: seq-db
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "latest"
32 changes: 32 additions & 0 deletions deployment/k8s/helm-chart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Helm Chart

Install [Helm](https://helm.sh/docs/intro/install/)

## Examples for Minikube Minikube

Install [Minikube](https://minikube.sigs.k8s.io/docs/start/)

### Install

```shell
helm upgrade --install seq-db . -f values.minikube.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While reading this some questions came up:

  • How I can specify replicas count for seqdb (as store) for seqdb (as proxy)?
  • Where configuration files are located?
  • Why there are two dirs for seq-ui and seq-proxy but there is no one for seq-db?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How I can specify replicas count for seqdb (as store) for seqdb (as proxy)?

You can set number of replicas by values (values.minikube.yaml):

replicaCount: 2
seqproxy:
  enabled: true
  replicaCount: 1

or using args:

helm upgrade --install seq-db . -f values.minikube.yaml --set replicaCount=1,seqproxy.replicaCount=1

Where configuration files are located?

Configmaps generates using values


# add ingress hosts
echo "$( minikube ip ) seq-proxy.local" >> /etc/hosts
echo "$( minikube ip ) sequi-server.local" >> /etc/hosts
echo "$( minikube ip ) sequi.local" >> /etc/hosts

# send test data
curl --request POST \
--url http://seq-proxy.local/_bulk \
--header 'Content-Type: application/json' \
--data '{"index" : {"unused-key":""}}
{"k8s_pod": "app-backend-123", "k8s_namespace": "production", "k8s_container": "app-backend", "request": "POST", "request_uri": "/api/v1/orders", "message": "New order created successfully"}
{"index" : {"unused-key":""}}
{"k8s_pod": "app-frontend-456", "k8s_namespace": "production", "k8s_container": "app-frontend", "request": "GET", "request_uri": "/api/v1/products", "message": "Product list retrieved"}
{"index" : {"unused-key":""}}
{"k8s_pod": "payment-service-789", "k8s_namespace": "production", "k8s_container": "payment-service", "request": "POST", "request_uri": "/api/v1/payments", "message": "failed"}
'
```

Open http://sequi.local/?from=3600
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe delete this file?

Empty file.
62 changes: 62 additions & 0 deletions deployment/k8s/helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "seq-db.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "seq-db.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "seq-db.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "seq-db.labels" -}}
helm.sh/chart: {{ include "seq-db.chart" . }}
{{ include "seq-db.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "seq-db.selectorLabels" -}}
app.kubernetes.io/name: {{ include "seq-db.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "seq-db.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "seq-db.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions deployment/k8s/helm-chart/templates/configmap-mappings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "seq-db.fullname" . }}-mappings
labels:
app: "{{ template "seq-db.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
data:
mappings.yaml: |
mapping-list:
{{ .Values.mapping.mapping_list | toYaml | indent 4 }}
31 changes: 31 additions & 0 deletions deployment/k8s/helm-chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "seq-db.fullname" . }}-config
labels:
app: "{{ template "seq-db.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
data:
config.yaml: |
storage:
data_dir: /data
{{- if .Values.storage.frac_size }}
frac_size: {{ .Values.storage.frac_size }}
{{- end }}
{{- if .Values.storage.total_size }}
total_size: {{ .Values.storage.total_size }}
{{- end }}
mapping:
enable_updates: {{ .Values.mapping.enable_updates }}
{{- if .Values.mapping.auto }}
path: auto
{{- else }}
path: /mappings/mappings.yaml
{{- end }}
update_period: {{ .Values.mapping.update_period }}
{{- with .Values.config }}
{{ toYaml . | nindent 4 }}
{{- else }}
{{- end }}
Loading
Loading