ClickHouse on Kubernetes!
Intro to the Kubernetes ClickHouse Operator
Altinity Engineering Team
Altinity Background
● Premier provider of software and services for ClickHouse
● Incorporated in UK with distributed team in US/Canada/Europe
● Main US/Europe sponsor of ClickHouse community
● Offerings:
○ 24x7 support for ClickHouse deployments
○ Software (Kubernetes, cluster manager, tools & utilities)
○ POCs/Training
What is ClickHouse?
Understands SQL
Runs on bare metal to cloud
Simple to install
Stores data in columns
Scales to many petabytes
Is Open source (Apache 2.0)
Is WAY fast!
Id a b c d
Id a b c d
Id a b c d
Id a b c d
What is Kubernetes?
“Kubernetes is the new Linux”
Actually it’s an open-source platform to:
● manage container-based systems
● build distributed applications declaratively
● allocate machine resources efficiently
● automate application deployment
Why run ClickHouse on Kubernetes?
1. Other applications are already there
2. Portability
3. Bring up data warehouses quickly
4. Easier to manage than deployment on hosts
What does ClickHouse look like on Kubernetes?
Shard 1 Replica 1
Zookeeper
Services
Zookeeper-0
Zookeeper-2
Zookeeper-1
Replica
Service
Load
Balancer
Service
Shard 1 Replica 2
Shard 2 Replica 1
Shard 2 Replica 2
Replica
Service
Replica
Service
Replica
Service
User Config Map Common Config Map
Stateful
Set
Pod
Persistent
Volume
Claim
Persistent
Volume
Per-replica Config Map
kube-system namespace
The ClickHouse operator turns complex data warehouse
configuration into a single easy-to-manage resource
ClickHouse
Operator
ClickHouseInstallation
YAML file
your-favorite namespace
ClickHouse
cluster
resources
(Apache 2.0 source,
distributed as Docker
image)
Installing and removing the ClickHouse operator
[Optional] Get sample files from github repo:
git clone https://github.com/Altinity/clickhouse-operator
Install the operator:
kubectl apply -f clickhouse-operator-install.yaml
Remove the operator:
kubectl delete -f clickhouse-operator-install.yaml
Let’s start with a single-node cluster
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "demo-01"
spec:
configuration:
clusters:
- name: "demo-01"
layout:
type: Standard
shardsCount: 1
replicasCount: 1
WARNING: This installation lacks
persistent storage
See examples in later slides for
storage definition
Next let’s add a shard
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "demo-01"
spec:
configuration:
clusters:
- name: "demo-01"
layout:
type: Standard
shardsCount: 2
replicasCount: 1
How to access your ClickHouse data warehouse on
Kubernetes
Connect from within Kubernetes using service DNS name
# Use load balancer
clickhouse-client --host clickhouse-demo-01.test
# Connect to specific node
clickhouse-client --host chi-a82946-2946-0-0.test
Connect from outside Kubernetes using Ingress or Nodeport
# Kops deployment on AWS configures external ingress.
clickhouse-client --host $AWS_ELB_HOST_NAME
Replication requires Zookeeper to be enabled
Install minimal Zookeeper in separate namespace.
kubectl create ns zoons
kubectl apply -f zookeeper-1-node.yaml -n zoons
watch kubectl -n zoons get all
Note ZK node DNS name: zookeeper-0.zookeepers.zoons
You can also install using helm *or* use external ZK cluster
After inserting a ‘zookeepers’ clause we can add replicas
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "demo-01"
spec:
configuration:
zookeeper:
nodes:
- host: zookeeper-0.zookeepers.zoons
port: 2181
clusters:
- name: "demo-01"
layout:
type: Standard
shardsCount: 2
replicasCount: 2
NOTE: Non-replicated tables do not
replicate automatically when replicas
are added
TIP: Confirm the DNS name of
Zookeeper from with a pod
We can add and modify users with the ‘users’ clause
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "demo-01"
spec:
configuration:
users:
demo/default: secret
demo/password: demo
demo/profile: default
demo/quota: default
demo/networks/ip: "::/0"
clusters:
- name: "demo-01"
layout:
type: Standard
shardsCount: 2
replicasCount: 1
TIP: User and profile changes take a
few minutes to propagate. Confirm
changes using clickhouse-client
To make storage persistent and set properties add an
explicit volume claim template with class and size
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "storage"
spec:
defaults:
deployment:
volumeClaimTemplate: storage-vc-template
templates:
volumeClaimTemplates:
- name: storage-vc-template
persistentVolumeClaim:
metadata:
name: USE_DEFAULT_NAME
spec:
storageClassName: default
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
configuration:
TIP: Check syntax carefully as
errors may result in failures to
allocate or mount volumes
TIP: Confirm storage by
‘kubectl exec’ into pod; run ‘df
-h’ to confirm mount
storageClassName can be used to set the proper class of
storage as well as disable dynamic provisioning
Use kubectl to find available storage classes:
kubectl describe StorageClass
Bind to default storage:
spec:
storageClassName: default
Bind to gp2 type
spec:
storageClassName: gp2
Disable dynamic provisioning and use static PVs:
spec:
storageClassName: ‘’
Set the ClickHouse version using a podTemplate
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: "demo-02"
spec:
defaults:
deployment:
podTemplate: clickhouse-stable
volumeClaimTemplate: storage-vc-template
templates:
podTemplates:
- name: clickhouse-stable
containers:
- name: clickhouse
image: yandex/clickhouse-server:18.16.1
volumeClaimTemplates:
# Etc.
TIP: Always specify the
image version fully; do not
use ‘latest’ tag
More pod template tricks: controlling resources
spec:
defaults:
deployment:
podTemplate: clickhouse-stable
volumeClaimTemplate: storage-vc-template
templates:
podTemplates:
- name: clickhouse-stable
containers:
- name: clickhouse
image: yandex/clickhouse-server:18.16.1
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "512Mi"
Advice, encouragement, and caveats
● Clickhouse operator is in beta
● Operator does not always detect errors in manifest files
● Error logging is limited, will be improved shortly
● Connectivity is a work in progress
● It’s a great way to explore cluster configurations
Please explore the operator and log issues on Github!!!
Partial roadmap for the operator and other Altinity projects
● Make operator status more transparent
● Default configuration templates
● ClickHouse health checks
● Predefined Grafana monitoring dashboards
Coming soon:
● Altinity Cluster Manager
● Storage management starting with backup/restore
More information on Altinity ClickHouse Operator...
ClickHouse Operator Github Project:
https://github.com/Altinity/clickhouse-operator
Altinity Blog -- https://www.altinity.com/blog
Webinars like this one!
Questions?
Thank you!
Contacts:
info@altinity.com
Visit us at:
https://www.altinity.com
Read Our Blog:
https://www.altinity.com/blog

More Related Content

PDF
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
PDF
ClickHouse Materialized Views: The Magic Continues
PDF
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
PDF
ClickHouse Deep Dive, by Aleksei Milovidov
PDF
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
PDF
10 Good Reasons to Use ClickHouse
PDF
A day in the life of a click house query
PDF
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
ClickHouse Materialized Views: The Magic Continues
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
ClickHouse Deep Dive, by Aleksei Milovidov
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
10 Good Reasons to Use ClickHouse
A day in the life of a click house query
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf

What's hot (20)

PDF
Altinity Quickstart for ClickHouse
PDF
All about Zookeeper and ClickHouse Keeper.pdf
PDF
Your first ClickHouse data warehouse
PDF
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
PDF
A Day in the Life of a ClickHouse Query Webinar Slides
PDF
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
PDF
My first 90 days with ClickHouse.pdf
PDF
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
PDF
ClickHouse Keeper
PDF
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
PDF
A Fast Intro to Fast Query with ClickHouse, by Robert Hodges
PDF
ClickHouse Features for Advanced Users, by Aleksei Milovidov
PDF
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
PDF
ClickHouse Monitoring 101: What to monitor and how
PDF
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
PDF
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
PDF
Better than you think: Handling JSON data in ClickHouse
PPTX
High Performance, High Reliability Data Loading on ClickHouse
PDF
Creating Beautiful Dashboards with Grafana and ClickHouse
PDF
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
Altinity Quickstart for ClickHouse
All about Zookeeper and ClickHouse Keeper.pdf
Your first ClickHouse data warehouse
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
A Day in the Life of a ClickHouse Query Webinar Slides
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
My first 90 days with ClickHouse.pdf
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Keeper
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
A Fast Intro to Fast Query with ClickHouse, by Robert Hodges
ClickHouse Features for Advanced Users, by Aleksei Milovidov
ClickHouse Query Performance Tips and Tricks, by Robert Hodges, Altinity CEO
ClickHouse Monitoring 101: What to monitor and how
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
Better than you think: Handling JSON data in ClickHouse
High Performance, High Reliability Data Loading on ClickHouse
Creating Beautiful Dashboards with Grafana and ClickHouse
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
Ad

Similar to ClickHouse on Kubernetes! By Robert Hodges, Altinity CEO (20)

PDF
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
PDF
Data warehouse on Kubernetes - gentle intro to Clickhouse Operator, by Robert...
PDF
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
PDF
Data Con LA 2019 - Data warehouse and Kubernetes: Lessons from ClickHouse Ope...
PDF
Data Warehouse on Kubernetes: lessons from Clickhouse Operator
PDF
Altinity Cluster Manager: ClickHouse Management for Kubernetes and Cloud
PDF
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
PDF
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
PDF
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
PPTX
K8s in 3h - Kubernetes Fundamentals Training
PDF
Growing up fast: Kubernetes and Real-Time Analytic Applications
PDF
Effective Platform Building with Kubernetes. Is K8S new Linux?
PDF
Introduction of kubernetes rancher
PDF
Is It Safe? Security Hardening for Databases Using Kubernetes Operators
PDF
Kubernetes for Java Developers
PDF
Altinity Quickstart for ClickHouse-2202-09-15.pdf
PDF
Kubernetes for java developers - Tutorial at Oracle Code One 2018
PPTX
Data weekender deploying prod grade sql 2019 big data clusters
PDF
Get you Java application ready for Kubernetes !
PDF
Managing kubernetes clusters easily with rancher
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
Data warehouse on Kubernetes - gentle intro to Clickhouse Operator, by Robert...
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
Data Con LA 2019 - Data warehouse and Kubernetes: Lessons from ClickHouse Ope...
Data Warehouse on Kubernetes: lessons from Clickhouse Operator
Altinity Cluster Manager: ClickHouse Management for Kubernetes and Cloud
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
K8s in 3h - Kubernetes Fundamentals Training
Growing up fast: Kubernetes and Real-Time Analytic Applications
Effective Platform Building with Kubernetes. Is K8S new Linux?
Introduction of kubernetes rancher
Is It Safe? Security Hardening for Databases Using Kubernetes Operators
Kubernetes for Java Developers
Altinity Quickstart for ClickHouse-2202-09-15.pdf
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Data weekender deploying prod grade sql 2019 big data clusters
Get you Java application ready for Kubernetes !
Managing kubernetes clusters easily with rancher
Ad

More from Altinity Ltd (20)

PPTX
Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
PPTX
Building an Analytic Extension to MySQL with ClickHouse and Open Source
PDF
Fun with ClickHouse Window Functions-2021-08-19.pdf
PDF
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
PDF
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
PDF
ClickHouse ReplacingMergeTree in Telecom Apps
PDF
Adventures with the ClickHouse ReplacingMergeTree Engine
PDF
Building a Real-Time Analytics Application with Apache Pulsar and Apache Pinot
PDF
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
PDF
OSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdf
PDF
OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...
PDF
OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...
PDF
OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...
PDF
OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...
PDF
OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
PDF
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
PDF
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
PDF
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
PDF
OSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdf
PDF
OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...
Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
Building an Analytic Extension to MySQL with ClickHouse and Open Source
Fun with ClickHouse Window Functions-2021-08-19.pdf
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
ClickHouse ReplacingMergeTree in Telecom Apps
Adventures with the ClickHouse ReplacingMergeTree Engine
Building a Real-Time Analytics Application with Apache Pulsar and Apache Pinot
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdf
OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...
OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...
OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...
OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...
OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdf
OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...

Recently uploaded (20)

PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
PPTX
Training Program for knowledge in solar cell and solar industry
PDF
Statistics on Ai - sourced from AIPRM.pdf
PPTX
future_of_ai_comprehensive_20250822032121.pptx
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PPTX
Configure Apache Mutual Authentication
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PPTX
Build Your First AI Agent with UiPath.pptx
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
Advancing precision in air quality forecasting through machine learning integ...
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
The influence of sentiment analysis in enhancing early warning system model f...
PPTX
Internet of Everything -Basic concepts details
PDF
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
Training Program for knowledge in solar cell and solar industry
Statistics on Ai - sourced from AIPRM.pdf
future_of_ai_comprehensive_20250822032121.pptx
Custom Battery Pack Design Considerations for Performance and Safety
Configure Apache Mutual Authentication
Module 1 Introduction to Web Programming .pptx
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
Convolutional neural network based encoder-decoder for efficient real-time ob...
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Build Your First AI Agent with UiPath.pptx
Rapid Prototyping: A lecture on prototyping techniques for interface design
Improvisation in detection of pomegranate leaf disease using transfer learni...
Advancing precision in air quality forecasting through machine learning integ...
NewMind AI Weekly Chronicles – August ’25 Week IV
The influence of sentiment analysis in enhancing early warning system model f...
Internet of Everything -Basic concepts details
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf

ClickHouse on Kubernetes! By Robert Hodges, Altinity CEO

  • 1. ClickHouse on Kubernetes! Intro to the Kubernetes ClickHouse Operator Altinity Engineering Team
  • 2. Altinity Background ● Premier provider of software and services for ClickHouse ● Incorporated in UK with distributed team in US/Canada/Europe ● Main US/Europe sponsor of ClickHouse community ● Offerings: ○ 24x7 support for ClickHouse deployments ○ Software (Kubernetes, cluster manager, tools & utilities) ○ POCs/Training
  • 3. What is ClickHouse? Understands SQL Runs on bare metal to cloud Simple to install Stores data in columns Scales to many petabytes Is Open source (Apache 2.0) Is WAY fast! Id a b c d Id a b c d Id a b c d Id a b c d
  • 4. What is Kubernetes? “Kubernetes is the new Linux” Actually it’s an open-source platform to: ● manage container-based systems ● build distributed applications declaratively ● allocate machine resources efficiently ● automate application deployment
  • 5. Why run ClickHouse on Kubernetes? 1. Other applications are already there 2. Portability 3. Bring up data warehouses quickly 4. Easier to manage than deployment on hosts
  • 6. What does ClickHouse look like on Kubernetes? Shard 1 Replica 1 Zookeeper Services Zookeeper-0 Zookeeper-2 Zookeeper-1 Replica Service Load Balancer Service Shard 1 Replica 2 Shard 2 Replica 1 Shard 2 Replica 2 Replica Service Replica Service Replica Service User Config Map Common Config Map Stateful Set Pod Persistent Volume Claim Persistent Volume Per-replica Config Map
  • 7. kube-system namespace The ClickHouse operator turns complex data warehouse configuration into a single easy-to-manage resource ClickHouse Operator ClickHouseInstallation YAML file your-favorite namespace ClickHouse cluster resources (Apache 2.0 source, distributed as Docker image)
  • 8. Installing and removing the ClickHouse operator [Optional] Get sample files from github repo: git clone https://github.com/Altinity/clickhouse-operator Install the operator: kubectl apply -f clickhouse-operator-install.yaml Remove the operator: kubectl delete -f clickhouse-operator-install.yaml
  • 9. Let’s start with a single-node cluster apiVersion: "clickhouse.altinity.com/v1" kind: "ClickHouseInstallation" metadata: name: "demo-01" spec: configuration: clusters: - name: "demo-01" layout: type: Standard shardsCount: 1 replicasCount: 1 WARNING: This installation lacks persistent storage See examples in later slides for storage definition
  • 10. Next let’s add a shard apiVersion: "clickhouse.altinity.com/v1" kind: "ClickHouseInstallation" metadata: name: "demo-01" spec: configuration: clusters: - name: "demo-01" layout: type: Standard shardsCount: 2 replicasCount: 1
  • 11. How to access your ClickHouse data warehouse on Kubernetes Connect from within Kubernetes using service DNS name # Use load balancer clickhouse-client --host clickhouse-demo-01.test # Connect to specific node clickhouse-client --host chi-a82946-2946-0-0.test Connect from outside Kubernetes using Ingress or Nodeport # Kops deployment on AWS configures external ingress. clickhouse-client --host $AWS_ELB_HOST_NAME
  • 12. Replication requires Zookeeper to be enabled Install minimal Zookeeper in separate namespace. kubectl create ns zoons kubectl apply -f zookeeper-1-node.yaml -n zoons watch kubectl -n zoons get all Note ZK node DNS name: zookeeper-0.zookeepers.zoons You can also install using helm *or* use external ZK cluster
  • 13. After inserting a ‘zookeepers’ clause we can add replicas apiVersion: "clickhouse.altinity.com/v1" kind: "ClickHouseInstallation" metadata: name: "demo-01" spec: configuration: zookeeper: nodes: - host: zookeeper-0.zookeepers.zoons port: 2181 clusters: - name: "demo-01" layout: type: Standard shardsCount: 2 replicasCount: 2 NOTE: Non-replicated tables do not replicate automatically when replicas are added TIP: Confirm the DNS name of Zookeeper from with a pod
  • 14. We can add and modify users with the ‘users’ clause apiVersion: "clickhouse.altinity.com/v1" kind: "ClickHouseInstallation" metadata: name: "demo-01" spec: configuration: users: demo/default: secret demo/password: demo demo/profile: default demo/quota: default demo/networks/ip: "::/0" clusters: - name: "demo-01" layout: type: Standard shardsCount: 2 replicasCount: 1 TIP: User and profile changes take a few minutes to propagate. Confirm changes using clickhouse-client
  • 15. To make storage persistent and set properties add an explicit volume claim template with class and size apiVersion: "clickhouse.altinity.com/v1" kind: "ClickHouseInstallation" metadata: name: "storage" spec: defaults: deployment: volumeClaimTemplate: storage-vc-template templates: volumeClaimTemplates: - name: storage-vc-template persistentVolumeClaim: metadata: name: USE_DEFAULT_NAME spec: storageClassName: default accessModes: - ReadWriteOnce resources: requests: storage: 2Gi configuration: TIP: Check syntax carefully as errors may result in failures to allocate or mount volumes TIP: Confirm storage by ‘kubectl exec’ into pod; run ‘df -h’ to confirm mount
  • 16. storageClassName can be used to set the proper class of storage as well as disable dynamic provisioning Use kubectl to find available storage classes: kubectl describe StorageClass Bind to default storage: spec: storageClassName: default Bind to gp2 type spec: storageClassName: gp2 Disable dynamic provisioning and use static PVs: spec: storageClassName: ‘’
  • 17. Set the ClickHouse version using a podTemplate apiVersion: "clickhouse.altinity.com/v1" kind: "ClickHouseInstallation" metadata: name: "demo-02" spec: defaults: deployment: podTemplate: clickhouse-stable volumeClaimTemplate: storage-vc-template templates: podTemplates: - name: clickhouse-stable containers: - name: clickhouse image: yandex/clickhouse-server:18.16.1 volumeClaimTemplates: # Etc. TIP: Always specify the image version fully; do not use ‘latest’ tag
  • 18. More pod template tricks: controlling resources spec: defaults: deployment: podTemplate: clickhouse-stable volumeClaimTemplate: storage-vc-template templates: podTemplates: - name: clickhouse-stable containers: - name: clickhouse image: yandex/clickhouse-server:18.16.1 resources: requests: memory: "512Mi" cpu: "500m" limits: memory: "512Mi"
  • 19. Advice, encouragement, and caveats ● Clickhouse operator is in beta ● Operator does not always detect errors in manifest files ● Error logging is limited, will be improved shortly ● Connectivity is a work in progress ● It’s a great way to explore cluster configurations Please explore the operator and log issues on Github!!!
  • 20. Partial roadmap for the operator and other Altinity projects ● Make operator status more transparent ● Default configuration templates ● ClickHouse health checks ● Predefined Grafana monitoring dashboards Coming soon: ● Altinity Cluster Manager ● Storage management starting with backup/restore
  • 21. More information on Altinity ClickHouse Operator... ClickHouse Operator Github Project: https://github.com/Altinity/clickhouse-operator Altinity Blog -- https://www.altinity.com/blog Webinars like this one!
  • 22. Questions? Thank you! Contacts: [email protected] Visit us at: https://www.altinity.com Read Our Blog: https://www.altinity.com/blog