Skip to content

Commit a0ac641

Browse files
authored
Merge pull request #1718 from Altinity/0.25.0
0.25.0
2 parents 69d5e39 + 001f8c6 commit a0ac641

File tree

278 files changed

+18750
-2700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+18750
-2700
lines changed

.github/workflows/check_helm.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,19 @@ jobs:
2121
with:
2222
driver: docker
2323
container-runtime: containerd
24-
kubernetes-version: v1.31.0
24+
kubernetes-version: v1.33.0
2525
cpus: max
2626
memory: max
2727

28+
- uses: gabe565/setup-helm-docs-action@v1
29+
with:
30+
version: latest
31+
2832
- name: Local Helm Test
2933
run: |
3034
set -xe
3135
minikube kubectl create ns test
36+
./dev/generate_helm_chart.sh
3237
helm install -n test test-operator ./deploy/helm/clickhouse-operator/
3338
sleep 10
3439
workflow_count=$(kubectl get all --all-namespaces | grep -c "test-operator")
@@ -41,4 +46,8 @@ jobs:
4146
if [ "$configmap_count" -lt 9 ]; then
4247
echo "Error: ConfigMap count is less than 9. Current count: $configmap_count"
4348
exit 1
44-
fi
49+
fi
50+
kubectl apply -n test -f ./docs/chi-examples/01-simple-layout-01-1shard-1repl.yaml
51+
kubectl wait -n test --for=create chi/simple-01 --timeout=60s
52+
kubectl wait -n test --for=jsonpath='{.status.status}'=Completed chi/simple-01 --timeout=1m
53+
kubectl wait -n test --for=condition=Ready pod/chi-simple-01-simple-0-0-0

.github/workflows/run_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
driver: docker
4949
container-runtime: containerd
50-
kubernetes-version: v1.31.0
50+
kubernetes-version: v1.31.2
5151
cpus: max
5252
memory: max
5353

@@ -116,7 +116,7 @@ jobs:
116116
with:
117117
name: testflows-report
118118
path: |
119-
tests/report.html
119+
tests/*.html
120120
if-no-files-found: error
121121
retention-days: 90
122122

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Altinity Kubernetes Operator for ClickHouse®
1+
# Altinity® Kubernetes Operator for ClickHouse®
22

3-
Altinity Kubernetes Operator for ClickHouse creates, configures and manages ClickHouse clusters running on Kubernetes.
3+
The Altinity Kubernetes Operator for ClickHouse creates, configures and manages ClickHouse clusters running on Kubernetes.
44

55
[![Build Master](https://github.com/Altinity/clickhouse-operator/actions/workflows/build_master.yaml/badge.svg)](https://github.com/Altinity/clickhouse-operator/actions/workflows/build_master.yaml)
66
[![GitHub release](https://img.shields.io/github/v/release/altinity/clickhouse-operator?include_prereleases)](https://img.shields.io/github/v/release/altinity/clickhouse-operator?include_prereleases)

config/config-dev.yaml

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,15 @@ clickhouse:
119119
- settings/remote_servers/*: "no"
120120
- settings/user_directories/*: "no"
121121

122+
# these settings should not lead to pod restarts
123+
- settings/display_secrets_in_show_and_select: "no"
124+
122125
- zookeeper/*: "yes"
123126

124127
- files/*.xml: "yes"
125128
- files/config.d/*.xml: "yes"
126129
- files/config.d/*dict*.xml: "no"
130+
- files/config.d/*no_restart*: "no"
127131

128132
# exceptions in default profile
129133
- profiles/default/background_*_pool_size: "yes"
@@ -147,7 +151,6 @@ clickhouse:
147151
# These credentials are used for:
148152
# 1. Metrics requests
149153
# 2. Schema maintenance
150-
# 3. DROP DNS CACHE
151154
# User with these credentials can be specified in additional ClickHouse .xml config files,
152155
# located in 'clickhouse.configuration.file.path.user' folder
153156
username: "clickhouse_operator"
@@ -173,9 +176,61 @@ clickhouse:
173176
# Specified in seconds.
174177
timeouts:
175178
# Timout to setup connection from the operator to ClickHouse instances. In seconds.
176-
connect: 2
179+
connect: 1
177180
# Timout to perform SQL query from the operator to ClickHouse instances. In seconds.
178-
query: 5
181+
query: 4
182+
183+
################################################
184+
##
185+
## Addons specifies additional configuration sections
186+
## Should it be called something like "templates"?
187+
##
188+
################################################
189+
addons:
190+
rules:
191+
- version: "*"
192+
spec:
193+
configuration:
194+
users:
195+
profiles:
196+
quotas:
197+
settings:
198+
files:
199+
- version: ">= 23.3"
200+
spec:
201+
configuration:
202+
###
203+
### users.d is global while description depends on CH version which may vary on per-host basis
204+
### In case of global-ness this may be better to implement via auto-templates
205+
###
206+
### As a solution, this may be applied on the whole cluster based on any of its hosts
207+
###
208+
### What to do when host is just created? CH version is not known prior to CH started and user config is required before CH started.
209+
### We do not have any info about the cluster on initial creation
210+
###
211+
users:
212+
"{clickhouseOperatorUser}/access_management": 1
213+
"{clickhouseOperatorUser}/named_collection_control": 1
214+
"{clickhouseOperatorUser}/show_named_collections": 1
215+
"{clickhouseOperatorUser}/show_named_collections_secrets": 1
216+
profiles:
217+
quotas:
218+
settings:
219+
files:
220+
221+
- version: ">= 23.5"
222+
spec:
223+
configuration:
224+
users:
225+
profiles:
226+
clickhouse_operator/format_display_secrets_in_show_and_select: 1
227+
quotas:
228+
settings:
229+
##
230+
## this may be added on per-host basis into host's conf.d folder
231+
##
232+
display_secrets_in_show_and_select: 1
233+
files:
179234

180235
#################################################
181236
##
@@ -250,7 +305,7 @@ reconcile:
250305
# Reconcile runtime settings
251306
runtime:
252307
# Max number of concurrent CHI reconciles in progress
253-
reconcileCHIsThreadsNumber: 10
308+
reconcileCHIsThreadsNumber: 1
254309

255310
# The operator reconciles shards concurrently in each CHI with the following limitations:
256311
# 1. Number of shards being reconciled (and thus having hosts down) in each CHI concurrently
@@ -261,7 +316,7 @@ reconcile:
261316
# Thus limiting number of shards being reconciled (and thus having hosts down) in each CHI by both number and percentage
262317

263318
# Max number of concurrent shard reconciles within one CHI in progress
264-
reconcileShardsThreadsNumber: 5
319+
reconcileShardsThreadsNumber: 1
265320
# Max percentage of concurrent shard reconciles within one CHI in progress
266321
reconcileShardsMaxConcurrencyPercent: 50
267322

@@ -306,6 +361,10 @@ reconcile:
306361
exclude: true
307362
queries: true
308363
include: false
364+
replicas:
365+
all: no
366+
new: yes
367+
delay: 10
309368

310369
################################################
311370
##

config/config.yaml

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ clickhouse:
119119
- settings/remote_servers/*: "no"
120120
- settings/user_directories/*: "no"
121121

122+
# these settings should not lead to pod restarts
123+
- settings/display_secrets_in_show_and_select: "no"
124+
122125
- zookeeper/*: "yes"
123126

124127
- files/*.xml: "yes"
@@ -177,6 +180,58 @@ clickhouse:
177180
# Timout to perform SQL query from the operator to ClickHouse instances. In seconds.
178181
query: 4
179182

183+
################################################
184+
##
185+
## Addons specifies additional configuration sections
186+
## Should it be called something like "templates"?
187+
##
188+
################################################
189+
addons:
190+
rules:
191+
- version: "*"
192+
spec:
193+
configuration:
194+
users:
195+
profiles:
196+
quotas:
197+
settings:
198+
files:
199+
- version: ">= 23.3"
200+
spec:
201+
configuration:
202+
###
203+
### users.d is global while description depends on CH version which may vary on per-host basis
204+
### In case of global-ness this may be better to implement via auto-templates
205+
###
206+
### As a solution, this may be applied on the whole cluster based on any of its hosts
207+
###
208+
### What to do when host is just created? CH version is not known prior to CH started and user config is required before CH started.
209+
### We do not have any info about the cluster on initial creation
210+
###
211+
users:
212+
"{clickhouseOperatorUser}/access_management": 1
213+
"{clickhouseOperatorUser}/named_collection_control": 1
214+
"{clickhouseOperatorUser}/show_named_collections": 1
215+
"{clickhouseOperatorUser}/show_named_collections_secrets": 1
216+
profiles:
217+
quotas:
218+
settings:
219+
files:
220+
221+
- version: ">= 23.5"
222+
spec:
223+
configuration:
224+
users:
225+
profiles:
226+
clickhouse_operator/format_display_secrets_in_show_and_select: 1
227+
quotas:
228+
settings:
229+
##
230+
## this may be added on per-host basis into host's conf.d folder
231+
##
232+
display_secrets_in_show_and_select: 1
233+
files:
234+
180235
#################################################
181236
##
182237
## Metrics collection
@@ -260,9 +315,9 @@ reconcile:
260315
# 3. The first shard is always reconciled alone. Concurrency starts from the second shard and onward.
261316
# Thus limiting number of shards being reconciled (and thus having hosts down) in each CHI by both number and percentage
262317

263-
# Max number of concurrent shard reconciles within one CHI in progress
318+
# Max number of concurrent shard reconciles within one cluster in progress
264319
reconcileShardsThreadsNumber: 5
265-
# Max percentage of concurrent shard reconciles within one CHI in progress
320+
# Max percentage of concurrent shard reconciles within one cluster in progress
266321
reconcileShardsMaxConcurrencyPercent: 50
267322

268323
# Reconcile StatefulSet scenario
@@ -306,6 +361,10 @@ reconcile:
306361
exclude: true
307362
queries: true
308363
include: false
364+
replicas:
365+
all: no
366+
new: yes
367+
delay: 10
309368

310369
################################################
311370
##

deploy/builder/build-clickhouse-operator-install-yaml.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ CH_PASSWORD_PLAIN="" \
3434
CH_CREDENTIALS_SECRET_NAME="clickhouse-operator" \
3535
CH_USERNAME_SECRET_PLAIN="clickhouse_operator" \
3636
CH_PASSWORD_SECRET_PLAIN="clickhouse_operator_password" \
37+
MANIFEST_PRINT_RBAC_NAMESPACED=yes \
38+
MANIFEST_PRINT_RBAC_CLUSTERED=yes \
3739
"${CUR_DIR}/cat-clickhouse-operator-install-yaml.sh" > "${MANIFEST_ROOT}/operator/clickhouse-operator-install-bundle.yaml"
3840

3941
# Build templated installation .yaml manifest

deploy/builder/cat-clickhouse-operator-install-yaml.sh

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ if [[ "${MANIFEST_PRINT_CRD}" == "yes" ]]; then
156156
envsubst
157157
fi
158158

159-
# Render RBAC section for ClusterRole
160-
if [[ "${MANIFEST_PRINT_RBAC_CLUSTERED}" == "yes" ]]; then
159+
if [[ "${MANIFEST_PRINT_RBAC_CLUSTERED}" == "yes" || "${MANIFEST_PRINT_RBAC_NAMESPACED}" == "yes" ]]; then
161160
# Render Account
162161
SECTION_FILE_NAME="clickhouse-operator-install-yaml-template-02-section-rbac-01-service-account.yaml"
163162
ensure_file "${TEMPLATES_DIR}" "${SECTION_FILE_NAME}" "${REPO_PATH_TEMPLATES_PATH}"
@@ -168,7 +167,10 @@ if [[ "${MANIFEST_PRINT_RBAC_CLUSTERED}" == "yes" ]]; then
168167
NAME="clickhouse-operator" \
169168
OPERATOR_VERSION="${OPERATOR_VERSION}" \
170169
envsubst
170+
fi
171171

172+
# Render RBAC section for ClusterRole
173+
if [[ "${MANIFEST_PRINT_RBAC_CLUSTERED}" == "yes" ]]; then
172174
# Render Role
173175
SECTION_FILE_NAME="clickhouse-operator-install-yaml-template-02-section-rbac-02-role.yaml"
174176
ensure_file "${TEMPLATES_DIR}" "${SECTION_FILE_NAME}" "${REPO_PATH_TEMPLATES_PATH}"
@@ -186,16 +188,6 @@ fi
186188

187189
# Render RBAC section for Role
188190
if [[ "${MANIFEST_PRINT_RBAC_NAMESPACED}" == "yes" ]]; then
189-
# Render Account
190-
SECTION_FILE_NAME="clickhouse-operator-install-yaml-template-02-section-rbac-01-service-account.yaml"
191-
ensure_file "${TEMPLATES_DIR}" "${SECTION_FILE_NAME}" "${REPO_PATH_TEMPLATES_PATH}"
192-
render_separator
193-
cat "${TEMPLATES_DIR}/${SECTION_FILE_NAME}" | \
194-
NAMESPACE="${OPERATOR_NAMESPACE}" \
195-
NAME="clickhouse-operator" \
196-
OPERATOR_VERSION="${OPERATOR_VERSION}" \
197-
envsubst
198-
199191
# Render Role
200192
SECTION_FILE_NAME="clickhouse-operator-install-yaml-template-02-section-rbac-02-role.yaml"
201193
ensure_file "${TEMPLATES_DIR}" "${SECTION_FILE_NAME}" "${REPO_PATH_TEMPLATES_PATH}"
@@ -211,7 +203,6 @@ if [[ "${MANIFEST_PRINT_RBAC_NAMESPACED}" == "yes" ]]; then
211203
envsubst
212204
fi
213205

214-
215206
# Render header/beginning of ConfigMap yaml specification:
216207
# apiVersion: v1
217208
# kind: ConfigMap

0 commit comments

Comments
 (0)