Skip to content

Commit ea4050c

Browse files
committed
feat: Initial helm chart for v2
1 parent 2fe79d7 commit ea4050c

File tree

14 files changed

+786
-0
lines changed

14 files changed

+786
-0
lines changed

charts/hdx-oss-v2/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: hdx-oss
3+
description: A Helm chart for HyperDX OSS
4+
type: application
5+
version: 0.1.0
6+
appVersion: "1.0.0"

charts/hdx-oss-v2/data/config.xml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
<?xml version="1.0"?>
2+
<clickhouse>
3+
<logger>
4+
<level>information</level>
5+
<console>true</console>
6+
<log remove="remove"/>
7+
<errorlog remove="remove"/>
8+
</logger>
9+
10+
<listen_host>0.0.0.0</listen_host>
11+
<http_port>{{ .Values.clickhouse.port }}</http_port>
12+
<tcp_port>{{ .Values.clickhouse.nativePort }}</tcp_port>
13+
14+
<max_connections>4096</max_connections>
15+
<keep_alive_timeout>64</keep_alive_timeout>
16+
<max_concurrent_queries>100</max_concurrent_queries>
17+
<uncompressed_cache_size>8589934592</uncompressed_cache_size>
18+
<mark_cache_size>5368709120</mark_cache_size>
19+
20+
<path>/var/lib/clickhouse/</path>
21+
<tmp_path>/var/lib/clickhouse/tmp/</tmp_path>
22+
<user_files_path>/var/lib/clickhouse/user_files/</user_files_path>
23+
24+
<users_config>users.xml</users_config>
25+
<default_profile>default</default_profile>
26+
<default_database>default</default_database>
27+
<timezone>UTC</timezone>
28+
<mlock_executable>false</mlock_executable>
29+
30+
<!-- Query log. Used only for queries with setting log_queries = 1. -->
31+
<query_log>
32+
<database>system</database>
33+
<table>query_log</table>
34+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
35+
</query_log>
36+
37+
<!-- Metric log contains rows with current values of ProfileEvents, CurrentMetrics collected with "collect_interval_milliseconds" interval. -->
38+
<metric_log>
39+
<database>system</database>
40+
<table>metric_log</table>
41+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
42+
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
43+
</metric_log>
44+
45+
<!--
46+
Asynchronous metric log contains values of metrics from
47+
system.asynchronous_metrics.
48+
-->
49+
<asynchronous_metric_log>
50+
<database>system</database>
51+
<table>asynchronous_metric_log</table>
52+
<!--
53+
Asynchronous metrics are updated once a minute, so there is
54+
no need to flush more often.
55+
-->
56+
<flush_interval_milliseconds>7000</flush_interval_milliseconds>
57+
</asynchronous_metric_log>
58+
59+
<!--
60+
OpenTelemetry log contains OpenTelemetry trace spans.
61+
-->
62+
<opentelemetry_span_log>
63+
<!--
64+
The default table creation code is insufficient, this <engine> spec
65+
is a workaround. There is no 'event_time' for this log, but two times,
66+
start and finish. It is sorted by finish time, to avoid inserting
67+
data too far away in the past (probably we can sometimes insert a span
68+
that is seconds earlier than the last span in the table, due to a race
69+
between several spans inserted in parallel). This gives the spans a
70+
global order that we can use to e.g. retry insertion into some external
71+
system.
72+
-->
73+
<engine>
74+
engine MergeTree
75+
partition by toYYYYMM(finish_date)
76+
order by (finish_date, finish_time_us, trace_id)
77+
</engine>
78+
<database>system</database>
79+
<table>opentelemetry_span_log</table>
80+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
81+
</opentelemetry_span_log>
82+
83+
84+
<!-- Crash log. Stores stack traces for fatal errors.
85+
This table is normally empty. -->
86+
<crash_log>
87+
<database>system</database>
88+
<table>crash_log</table>
89+
90+
<partition_by />
91+
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
92+
</crash_log>
93+
94+
<!-- Profiling on Processors level. -->
95+
<processors_profile_log>
96+
<database>system</database>
97+
<table>processors_profile_log</table>
98+
99+
<partition_by>toYYYYMM(event_date)</partition_by>
100+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
101+
</processors_profile_log>
102+
103+
<!-- Uncomment if use part log.
104+
Part log contains information about all actions with parts in MergeTree tables (creation, deletion, merges, downloads).-->
105+
<part_log>
106+
<database>system</database>
107+
<table>part_log</table>
108+
<partition_by>toYYYYMM(event_date)</partition_by>
109+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
110+
</part_log>
111+
112+
<!-- Trace log. Stores stack traces collected by query profilers.
113+
See query_profiler_real_time_period_ns and query_profiler_cpu_time_period_ns settings. -->
114+
<trace_log>
115+
<database>system</database>
116+
<table>trace_log</table>
117+
118+
<partition_by>toYYYYMM(event_date)</partition_by>
119+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
120+
</trace_log>
121+
122+
<!-- Query thread log. Has information about all threads participated in query execution.
123+
Used only for queries with setting log_query_threads = 1. -->
124+
<query_thread_log>
125+
<database>system</database>
126+
<table>query_thread_log</table>
127+
<partition_by>toYYYYMM(event_date)</partition_by>
128+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
129+
</query_thread_log>
130+
131+
<!-- Query views log. Has information about all dependent views associated with a query.
132+
Used only for queries with setting log_query_views = 1. -->
133+
<query_views_log>
134+
<database>system</database>
135+
<table>query_views_log</table>
136+
<partition_by>toYYYYMM(event_date)</partition_by>
137+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
138+
</query_views_log>
139+
140+
<distributed_ddl>
141+
<path>/clickhouse/task_queue/ddl</path>
142+
</distributed_ddl>
143+
144+
<format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
145+
</clickhouse>

charts/hdx-oss-v2/data/users.xml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0"?>
2+
<clickhouse>
3+
<profiles>
4+
<default>
5+
<max_memory_usage>10000000000</max_memory_usage>
6+
<use_uncompressed_cache>0</use_uncompressed_cache>
7+
<load_balancing>in_order</load_balancing>
8+
<log_queries>1</log_queries>
9+
</default>
10+
<readonly>
11+
<readonly>2</readonly>
12+
</readonly>
13+
</profiles>
14+
15+
<users>
16+
<default>
17+
<password></password>
18+
<profile>default</profile>
19+
<networks>
20+
<ip>::1</ip>
21+
<ip>127.0.0.1</ip>
22+
</networks>
23+
<quota>default</quota>
24+
</default>
25+
<app>
26+
<password>{{ .Values.clickhouse.config.users.appUserPassword }}</password>
27+
<networks>
28+
<host_regexp>.*\.svc\.cluster\.local$</host_regexp>
29+
</networks>
30+
<profile>readonly</profile>
31+
<quota>default</quota>
32+
<grants>
33+
<query>GRANT SHOW ON *.*</query>
34+
<query>GRANT SELECT ON system.*</query>
35+
<query>GRANT SELECT ON default.*</query>
36+
</grants>
37+
</app>
38+
<otelcollector>
39+
<password>{{ .Values.clickhouse.config.users.otelUserPassword }}</password>
40+
<networks>
41+
<host_regexp>.*\.svc\.cluster\.local$</host_regexp>
42+
</networks>
43+
<profile>default</profile>
44+
<quota>default</quota>
45+
<grants>
46+
<query>GRANT SELECT,INSERT,SHOW ON default.*</query>
47+
</grants>
48+
</otelcollector>
49+
</users>
50+
51+
<quotas>
52+
<default>
53+
<interval>
54+
<duration>3600</duration>
55+
<queries>0</queries>
56+
<errors>0</errors>
57+
<result_rows>0</result_rows>
58+
<read_rows>0</read_rows>
59+
<execution_time>0</execution_time>
60+
</interval>
61+
</default>
62+
</quotas>
63+
</clickhouse>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
HyperDX has been installed.
2+
3+
Note: By default, this chart also installs clickhouse and the otel-collector. However, for production,
4+
it is recommended that you use the clickhouse and otel-collector operators instead.
5+
6+
To disable clickhouse and otel-collector, set the following values:
7+
helm install myrelease hyperdx-helm --set clickhouse.enabled=false --set clickhouse.persistence.enabled=false --set otel.enabled=false
8+
9+
Application URL: {{ include "hdx-oss.fullname" . }}-app:{{ .Values.hyperdx.appPort }}
10+
11+
To verify the deployment status, run:
12+
kubectl get pods -l "app.kubernetes.io/name={{ include "hdx-oss.name" . }}"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "hdx-oss.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
*/}}
11+
{{- define "hdx-oss.fullname" -}}
12+
{{- if .Values.fullnameOverride }}
13+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
14+
{{- else }}
15+
{{- $name := default .Chart.Name .Values.nameOverride }}
16+
{{- if contains $name .Release.Name }}
17+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
18+
{{- else }}
19+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
20+
{{- end }}
21+
{{- end }}
22+
{{- end }}
23+
24+
{{/*
25+
Create chart name and version as used by the chart label.
26+
*/}}
27+
{{- define "hdx-oss.chart" -}}
28+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
29+
{{- end }}
30+
31+
{{/*
32+
Common labels
33+
*/}}
34+
{{- define "hdx-oss.labels" -}}
35+
helm.sh/chart: {{ include "hdx-oss.chart" . }}
36+
{{ include "hdx-oss.selectorLabels" . }}
37+
{{- if .Chart.AppVersion }}
38+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
39+
{{- end }}
40+
app.kubernetes.io/managed-by: {{ .Release.Service }}
41+
{{- end }}
42+
43+
{{/*
44+
Selector labels
45+
*/}}
46+
{{- define "hdx-oss.selectorLabels" -}}
47+
app.kubernetes.io/name: {{ include "hdx-oss.name" . }}
48+
app.kubernetes.io/instance: {{ .Release.Name }}
49+
{{- end }}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "hdx-oss.fullname" . }}-app
5+
labels:
6+
{{- include "hdx-oss.labels" . | nindent 4 }}
7+
app: app
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
{{- include "hdx-oss.selectorLabels" . | nindent 6 }}
13+
app: app
14+
template:
15+
metadata:
16+
labels:
17+
{{- include "hdx-oss.selectorLabels" . | nindent 8 }}
18+
app: app
19+
spec:
20+
initContainers:
21+
- name: wait-for-mongodb
22+
image: busybox
23+
command: ['sh', '-c', 'until nc -z {{ include "hdx-oss.fullname" . }}-mongodb {{ .Values.mongodb.port }}; do echo waiting for mongodb; sleep 2; done;']
24+
containers:
25+
- name: app
26+
image: "{{ .Values.images.hdx.repository }}:{{ .Values.images.hdx.tag }}"
27+
ports:
28+
- name: app-port
29+
containerPort: {{ .Values.hyperdx.appPort }}
30+
- name: api-port
31+
containerPort: {{ .Values.hyperdx.apiPort }}
32+
envFrom:
33+
- configMapRef:
34+
name: {{ include "hdx-oss.fullname" . }}-app-config
35+
env:
36+
- name: HYPERDX_API_KEY
37+
valueFrom:
38+
secretKeyRef:
39+
name: {{ include "hdx-oss.fullname" . }}-app-secrets
40+
key: api-key
41+
---
42+
apiVersion: v1
43+
kind: Service
44+
metadata:
45+
name: {{ include "hdx-oss.fullname" . }}-app
46+
labels:
47+
{{- include "hdx-oss.labels" . | nindent 4 }}
48+
spec:
49+
type: LoadBalancer
50+
ports:
51+
- port: {{ .Values.hyperdx.appPort }}
52+
targetPort: {{ .Values.hyperdx.appPort }}
53+
name: app
54+
selector:
55+
{{- include "hdx-oss.selectorLabels" . | nindent 4 }}
56+
app: app
57+
---
58+
apiVersion: networking.k8s.io/v1
59+
kind: Ingress
60+
metadata:
61+
name: {{ include "hdx-oss.fullname" . }}-app-ingress
62+
labels:
63+
{{- include "hdx-oss.labels" . | nindent 4 }}
64+
annotations:
65+
nginx.ingress.kubernetes.io/rewrite-target: /$1
66+
nginx.ingress.kubernetes.io/use-regex: "true"
67+
{{- if .Values.hyperdx.ingress.tls.enabled }}
68+
nginx.ingress.kubernetes.io/ssl-redirect: "true"
69+
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
70+
{{- end }}
71+
nginx.ingress.kubernetes.io/proxy-body-size: {{ .Values.hyperdx.ingress.proxyBodySize | quote }}
72+
nginx.ingress.kubernetes.io/proxy-connect-timeout: {{ .Values.hyperdx.ingress.proxyConnectTimeout | quote }}
73+
nginx.ingress.kubernetes.io/proxy-send-timeout: {{ .Values.hyperdx.ingress.proxySendTimeout | quote }}
74+
nginx.ingress.kubernetes.io/proxy-read-timeout: {{ .Values.hyperdx.ingress.proxyReadTimeout | quote }}
75+
spec:
76+
ingressClassName: nginx
77+
{{- if .Values.hyperdx.ingress.tls.enabled }}
78+
tls:
79+
- hosts:
80+
- {{ .Values.hyperdx.ingress.host | default "localhost" }}
81+
secretName: {{ .Values.hyperdx.ingress.tlsSecretName | default "hyperdx-tls" }}
82+
{{- end }}
83+
rules:
84+
- host: {{ .Values.hyperdx.ingress.host | default "localhost" }}
85+
http:
86+
paths:
87+
- path: /(.*)
88+
pathType: Prefix
89+
backend:
90+
service:
91+
name: {{ include "hdx-oss.fullname" . }}-app
92+
port:
93+
number: {{ .Values.hyperdx.appPort }}

0 commit comments

Comments
 (0)