forked from Altinity/clickhouse-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-templates-05-sidecar.yaml
77 lines (75 loc) · 1.99 KB
/
02-templates-05-sidecar.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
apiVersion: v1
kind: "ConfigMap"
metadata:
name: "sidecar-mounted-configmap"
data:
config-file-1.xml: |
<tag1>
<!-- Here goes some example config -->
<listen_host_1>0.0.0.0</listen_host_1>
</tag1>
config-file-2.xml: |
<tag2>
<!-- Here goes some example config -->
<listen_host_2>0.0.0.0</listen_host_2>
</tag2>
---
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "sidecar"
spec:
configuration:
clusters:
- name: "sc"
layout:
shardsCount: 1
replicasCount: 1
defaults:
templates:
# Templates are specified as default for all clusters
podTemplate: pod-template
dataVolumeClaimTemplate: data-volume-template
logVolumeClaimTemplate: log-volume-template
templates:
podTemplates:
- name: pod-template
spec:
containers:
# Main container
- name: clickhouse
image: yandex/clickhouse-server:19.16
volumeMounts:
- name: sidecar-configmap-volume
mountPath: /configmap-volume
# Sidecar container
- name: custom-sidecar
image: busybox
command:
- "/bin/sh"
- "-c"
- "--"
args:
- "while true; do sleep 30; done;"
volumeMounts:
- name: sidecar-configmap-volume
mountPath: /configmap-volume
volumes:
- name: sidecar-configmap-volume
configMap:
name: sidecar-mounted-configmap
volumeClaimTemplates:
- name: data-volume-template
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
- name: log-volume-template
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi