-
Notifications
You must be signed in to change notification settings - Fork 459
/
20-protobuf-schema-example.yaml
67 lines (62 loc) · 2.05 KB
/
20-protobuf-schema-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
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "protobuf-example"
spec:
configuration:
files:
your_schema.proto: |
syntax = "proto3";
message MessageType {
string name = 1;
string surname = 2;
uint32 birthDate = 3;
repeated string phoneNumbers = 4;
};
clusters:
- name: cluster
layout:
shardsCount: 1
replicasCount: 1
defaults:
templates:
podTemplate: pod-template-with-init-container
dataVolumeClaimTemplate: data-volume-template
logVolumeClaimTemplate: data-volume-template
templates:
podTemplates:
- name: pod-template-with-init-container
spec:
securityContext:
runAsUser: 101
runAsGroup: 101
fsGroup: 101
capabilities:
add: [ "CAP_NICE", "CAP_IPC_LOCK" ]
containers:
- name: clickhouse
image: clickhouse/clickhouse-server:latest
initContainers:
- name: copy
image: alpine:latest
command: ["sh", "-xc", "while [[ \"0\" == $(ls -la /etc/clickhouse-server/config.d/*.proto 2> /dev/null | wc -l) ]]; do echo '*.proto not found, sleep 30 sec' ; sleep 30; done; ls -la /var/lib/clickhouse/; mkdir -p /var/lib/clickhouse/format_schemas/; cp -L -rfv /etc/clickhouse-server/config.d/*.proto /var/lib/clickhouse/format_schemas/"]
volumeMounts:
- mountPath: /etc/clickhouse-server/config.d/
name: chi-protobuf-example-common-configd
- mountPath: /var/lib/clickhouse
name: data-volume-template
volumeClaimTemplates:
- name: data-volume-template
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- name: log-volume-template
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi