-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example for ClickHouseInstallationTemplate and ClickHouseInstalla…
…tion with added additonal volume with emptyDir to using local disk (#1622)
- Loading branch information
Showing
1 changed file
with
116 additions
and
0 deletions.
There are no files selected for viewing
116 changes: 116 additions & 0 deletions
116
docs/chi-examples/03-persistent-volume-09-with-template-emptydir.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
apiVersion: clickhouse.altinity.com/v1 | ||
kind: ClickHouseInstallationTemplate | ||
metadata: | ||
name: instance-store-emptydir-template | ||
spec: | ||
templating: | ||
policy: auto | ||
chiSelector: | ||
clickhouse.altinity.com/chi: s3-cache-via-template | ||
|
||
templates: | ||
podTemplates: | ||
- name: pod-template | ||
spec: | ||
volumes: | ||
- name: clickhouse-nvme-cache | ||
emptyDir: {} | ||
|
||
containers: | ||
- name: clickhouse-pod | ||
# CHIT have more priority than CHI, and override whole volumeMounts section | ||
volumeMounts: | ||
- name: data-storage-vc-template-1 | ||
mountPath: /var/lib/clickhouse | ||
- name: clickhouse-nvme-cache | ||
mountPath: /var/lib/clickhouse/disks/s3_cache/ | ||
|
||
--- | ||
apiVersion: "clickhouse.altinity.com/v1" | ||
kind: "ClickHouseInstallation" | ||
metadata: | ||
name: "s3-cache-via-template" | ||
labels: | ||
clickhouse.altinity.com/chi: s3-cache-via-template | ||
spec: | ||
configuration: | ||
clusters: | ||
- name: "cluster" | ||
templates: | ||
podTemplate: pod-template | ||
layout: | ||
shardsCount: 1 | ||
replicasCount: 1 | ||
files: | ||
config.d/storage_configuration.xml: | | ||
<clickhouse> | ||
<storage_configuration> | ||
<disks> | ||
<s3_disk> | ||
<type>s3</type> | ||
<endpoint>https://sample-bucket.s3.amazonaws.com/s3_disk/{replica}</endpoint> | ||
<access_key_id>your_access_key_id</access_key_id> | ||
<secret_access_key>your_secret_access_key</secret_access_key> | ||
<region>us-east-2</region> | ||
<metadata_path>/var/lib/clickhouse/disks/s3_disk/</metadata_path> | ||
</s3_disk> | ||
<s3_cache> | ||
<type>cache</type> | ||
<disk>s3_disk</disk> | ||
<path>/var/lib/clickhouse/disks/s3_cache/</path> | ||
<max_size>10Gi</max_size> | ||
</s3_cache> | ||
</disks> | ||
<policies> | ||
<s3_only> | ||
<volumes> | ||
<main> | ||
<disk>s3_disk</disk> | ||
</main> | ||
</volumes> | ||
</s3_only> | ||
<s3_cache> | ||
<volumes> | ||
<main> | ||
<disk>s3_cache</disk> | ||
</main> | ||
</volumes> | ||
</s3_cache> | ||
<s3_cache_tiered> | ||
<volumes> | ||
<hot> | ||
<disk>default</disk> | ||
</hot> | ||
<cold> | ||
<disk>s3_cache</disk> | ||
</cold> | ||
</volumes> | ||
</s3_cache_tiered> | ||
</policies> | ||
</storage_configuration> | ||
</clickhouse> | ||
templates: | ||
podTemplates: | ||
- name: pod-template | ||
spec: | ||
containers: | ||
- name: clickhouse | ||
image: clickhouse/clickhouse-server:latest | ||
imagePullPolicy: IfNotPresent | ||
volumeMounts: | ||
- name: data-storage-vc-template-1 | ||
mountPath: /var/lib/clickhouse | ||
command: | ||
- clickhouse-server | ||
- --config-file=/etc/clickhouse-server/config.xml | ||
|
||
volumeClaimTemplates: | ||
- name: data-storage-vc-template-1 | ||
spec: | ||
# storageClassName: standard | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 10Gi |