forked from Altinity/clickhouse-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
25-timeseries-engine-example.yaml
82 lines (82 loc) · 2.3 KB
/
25-timeseries-engine-example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
apiVersion: v1
kind: ConfigMap
metadata:
name: clickhouse-initdb-schema
data:
init_schema.sql: |
CREATE DATABASE IF NOT EXISTS timeseries_db;
CREATE TABLE IF NOT EXISTS timeseries_db.timeseires_table ENGINE=TimeSeries;
---
apiVersion: clickhouse.altinity.com/v1
kind: ClickHouseInstallation
metadata:
name: timeseries
spec:
templates:
serviceTemplates:
- name: timeseries
spec:
type: ClusterIP
ports:
- name: http
port: 8123
- name: tcp
port: 9000
- name: prometheus
port: 9363
podTemplates:
- name: timeseries
spec:
volumes:
- name: initdb-volume
configMap:
name: clickhouse-initdb-schema
defaultMode: 0555
containers:
- name: clickhouse
image: clickhouse/clickhouse-server:latest
env:
- name: CLICKHOUSE_ALWAYS_RUN_INITDB_SCRIPTS
value: "true"
volumeMounts:
- name: initdb-volume
mountPath: /docker-entrypoint-initdb.d
readOnly: true
configuration:
profiles:
default/allow_experimental_time_series_table: 1
files:
config.d/prometheus_read_and_write.xml: |
<clickhouse>
<prometheus>
<port>9363</port>
<handlers>
<prometheus_write_rule>
<url>/write</url>
<handler>
<type>remote_write</type>
<database>timeseries_db</database>
<table>timeseries_table</table>
</handler>
</prometheus_write_rule>
<prometheus_read_rule>
<url>/read</url>
<handler>
<type>remote_read</type>
<database>timeseries_db</database>
<table>timeseries_table</table>
</handler>
</prometheus_read_rule>
</handlers>
</prometheus>
</clickhouse>
clusters:
- name: timeseries
layout:
replicasCount: 1
shardsCount: 1
defaults:
templates:
podTemplate: timeseries
serviceTemplate: timeseries