8000 0.27.0 by alex-zaitsev · Pull Request #1981 · Altinity/clickhouse-operator · GitHub
[go: up one dir, main page]

Skip to content
Merged

0.27.0 #1981

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
270 commits
Select commit Hold shift + click to select a range
93a79e8
dev: introduce hooks type
sunsingerus Apr 6, 2026
9971fcc
dev: introduce hoks into config
sunsingerus Apr 6, 2026
679ad22
dev: hooks in reconcile
sunsingerus Apr 6, 2026
a316654
dev: reconcile hooks
sunsingerus Apr 6, 2026
c341529
dev: main hooks logic
sunsingerus Apr 6, 2026
70f8fe7
dev: code deep copy
sunsingerus Apr 6, 2026
1be8aba
test: test 62 manifest
sunsingerus Apr 6, 2026
2d1453b
dev: example
sunsingerus Apr 6, 2026
b50b761
env: manifests
sunsingerus Apr 6, 2026
5d15d7c
env: helm
sunsingerus Apr 6, 2026
1985339
build(deps): bump go.opentelemetry.io/otel/sdk from 1.42.0 to 1.43.0
dependabot[bot] Apr 8, 2026
d0a22b7
Merge pull request #1953 from Altinity/dependabot/go_modules/go.opent…
Slach Apr 9, 2026
cc8fc75
fix: format string issues
destinyoooo Apr 12, 2026
226bdda
Merge pull request #1955 from destinyoooo/master
sunsingerus Apr 13, 2026
e32f975
Update FIPS version
alex-zaitsev Apr 13, 2026
1204a1a
Merge branch '0.27.0' of https://github.com/Altinity/clickhouse-opera…
alex-zaitsev Apr 13, 2026
a21ba7e
dev: add coordination section into config
sunsingerus Apr 14, 2026
6eec95f
dev: add coordination section to CRD
sunsingerus Apr 14, 2026
9969073
dev: introduce chk ref in chi
sunsingerus Apr 14, 2026
65cd374
dev: start with chk constructor
sunsingerus Apr 14, 2026
00820d2
dev: expand hopst zk functionality
sunsingerus Apr 14, 2026
4dc4eb6
dev: add keeper and clarify zookeeper types
sunsingerus Apr 14, 2026
f15e8cc
dev: zk node constructir and port creator
sunsingerus Apr 14, 2026
e13156a
dev: chop coordination section
sunsingerus Apr 14, 2026
0692974
dv: introduce keeper ref
sunsingerus Apr 14, 2026
9337fe5
dev: add keeper resolver into CHI builder
sunsingerus Apr 14, 2026
123d0c6
dev: add service fqdn namer
sunsingerus Apr 14, 2026
0e24d68
dev: add chk ref resolver functionality
sunsingerus Apr 14, 2026
b30ffc9
dev: copier
sunsingerus Apr 14, 2026
fc14c47
docs: keeper ref example
sunsingerus Apr 14, 2026
00833ed
docs: 99-max
sunsingerus Apr 14, 2026
ed9b3d0
env: manifests
sunsingerus Apr 14, 2026
c55bde5
env: helm chart
sunsingerus Apr 14, 2026
8c75b33
dev: configs
sunsingerus Apr 14, 2026
d5ba3e6
test: keeper ref test
sunsingerus Apr 14, 2026
304c057
dev: minor
sunsingerus Apr 14, 2026
23a00c9
Update go 1.26.2
alex-zaitsev Apr 14, 2026
221e69e
Change keeper coordination settings
alex-zaitsev Apr 14, 2026
4f42382
Update Keeper version in tests
alex-zaitsev Apr 14, 2026
1c10879
Fix: Prevent CrashLoopBackOff during image upgrade with RollingUpdate
dashashutosh80 Apr 15, 2026
b45c85e
Merge pull request #1956 from dashashutosh80/0.26.3
alex-zaitsev Apr 15, 2026
b0890cd
dev: add dynamic clientset
sunsingerus Apr 15, 2026
f469316
dev: start shift to updated dynamic client
sunsingerus Apr 15, 2026
f4dc3f1
dev: introduce chk watcher
sunsingerus Apr 15, 2026
efb0b58
dev: keeper
sunsingerus Apr 15, 2026
7cdd5fe
dev: start chk watcher
sunsingerus Apr 15, 2026
25ef00b
dev: adjust controller
sunsingerus Apr 15, 2026
4d9624f
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 15, 2026
5e51832
Change keeper coordination settings
alex-zaitsev Apr 14, 2026
f4774d6
Update Keeper version in tests
alex-zaitsev Apr 14, 2026
caa858c
Fix: Prevent CrashLoopBackOff during image upgrade with RollingUpdate
dashashutosh80 Apr 15, 2026
f5e402f
dev: merge
sunsingerus Apr 15, 2026
baad874
env: manifests
sunsingerus Apr 15, 2026
34f55e0
env: helm chart
sunsingerus Apr 15, 2026
ee8f0bc
dev: releases
sunsingerus Apr 15, 2026
97c0f35
Merge branch '0.26.3' into 0.27.0
sunsingerus Apr 15, 2026
7b6adeb
test: smoothen parallel start
sunsingerus Apr 15, 2026
6154d1b
test: add watcher
sunsingerus Apr 16, 2026
6d8f517
Merge remote-tracking branch 'altinity/0.26.3' into 0.27.0
sunsingerus Apr 16, 2026
bdd6ebe
Merge remote-tracking branch 'altinity/master' into 0.27.0
sunsingerus Apr 16, 2026
6901a81
Improve keeper ref test
alex-zaitsev Apr 17, 2026
780d76a
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 17, 2026
b90a255
Watch ClickHouseOperatorConfiguration in operator namespace
alex-zaitsev Apr 17, 2026
d37caef
dev: Capitalised consts
sunsingerus Apr 17, 2026
a55c1ea
dev: capitalised consts for chopconf
sunsingerus Apr 17, 2026
3089ede
dev: improve error handling for keeper resolver
sunsingerus Apr 17, 2026
8909dbd
test: resolver
sunsingerus Apr 17, 2026
965961a
Remove printf that does not work on Mac and make it simple
alex-zaitsev Apr 17, 2026
bbe3aa4
dev: improve error handling
sunsingerus Apr 17, 2026
2161dc3
env: manifests
sunsingerus Apr 17, 2026
e3aa80b
env: helm chart
sunsingerus Apr 17, 2026
0e91392
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 17, 2026
7569bf1
doc: example
sunsingerus Apr 20, 2026
9b842fa
doc: CRD explanation
sunsingerus Apr 20, 2026
95e99ab
doc: operator configuration explanation
sunsingerus Apr 20, 2026
857678e
doc: keeper
sunsingerus Apr 20, 2026
10662f3
dev: manifest
sunsingerus Apr 20, 2026
< 8000 a href="/Altinity/clickhouse-operator/pull/1981/commits/f5daebc18365a80750aa262d0d7b409488c8c292" class="select-menu-item " role="menuitem" data-commit="f5daebc18365a80750aa262d0d7b409488c8c292" data-parent-commit="10662f3527a11f5a703d75788d5bb571f5a54063">
f5daebc
env: hub manifests
sunsingerus Apr 20, 2026
4593523
env: fix operatorhub CSV minKubeVersion and add resource requests
sunsingerus Apr 20, 2026
31ce0a8
Merge remote-tracking branch 'altinity/0.26.3' into 0.27.0
sunsingerus Apr 20, 2026
c2aa7b0
Merge pull request #1959 from Altinity/fix/chop-config-informer-names…
sunsingerus Apr 20, 2026
f137ce1
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 20, 2026
7583df7
chk probe crashloop fix
hananbs Apr 20, 2026
7a809cc
Merge pull request #1961 from hananbs/0.26.3-probe
sunsingerus Apr 20, 2026
fff79c2
Restart operator on config change
alex-zaitsev Apr 17, 2026
fc97de8
Regenerate clickhouse-operator install manifests
alex-zaitsev Apr 17, 2026
28b552e
Add a test for operator restart on configuration change
alex-zaitsev Apr 17, 2026
607cb13
Change onOperatorConfigurationChange to watch.configuration.onChange
alex-zaitsev Apr 20, 2026
b1af8bf
Add Watch.Configuration.OnChange to the helm values.
alex-zaitsev Apr 20, 2026
22c5cdc
test: bump previous version
sunsingerus Apr 21, 2026
2746243
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 21, 2026
be87631
dev: minor formatting
sunsingerus Apr 21, 2026
9c40366
Merge pull request #1960 from Altinity/fix/chop-config-restart-on-con…
sunsingerus Apr 21, 2026
d9146a4
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 21, 2026
cc6d33d
dev: intorduce ignore
sunsingerus Apr 21, 2026
dad903c
dev: use propoer const values
sunsingerus Apr 21, 2026
5a0505a
dev: clarification
sunsingerus Apr 21, 2026
0e6e11e
env: manifests
sunsingerus Apr 21, 2026
213b260
env: helm chart
sunsingerus Apr 21, 2026
68ff31b
Standardize retry sleep logic
alex-zaitsev Apr 21, 2026
8417e7d
Remove obsolete check
alex-zaitsev Apr 22, 2026
51225ed
Scope schema discovery to target host's cluster, not whole CHI
lukas-pfannschmidt-tr Apr 22, 2026
cc717c7
dev: cluster maintenance
sunsingerus Apr 22, 2026
a3ca86c
test: refresh images list
sunsingerus Apr 22, 2026
ffdbd1c
test: recovery
sunsingerus Apr 22, 2026
906ec7b
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 22, 2026
ec84623
reformat
alex-zaitsev Apr 22, 2026
01c730a
Cleanup
alex-zaitsev Apr 22, 2026
e7a3ac3
Refactored test test_010064. It fails on the primary CHK rescale
alex-zaitsev Apr 23, 2026
8df33a6
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 23, 2026
995df8c
Fix status hostsWithTablesCreated and hostsWithReplicaCaughtUp on
alex-zaitsev Apr 23, 2026
900f80d
Fix secret-backed env upgrade rollout
alex-zaitsev Apr 24, 2026
07dcdda
dev: add accessors
sunsingerus Apr 24, 2026
febfde3
dev: expand interface
sunsingerus Apr 24, 2026
682b66f
dev: move to nil-safe chains
sunsingerus Apr 24, 2026
f98c7dc
dev: accessors
sunsingerus Apr 24, 2026
e337b28
dev: intorduce recovery reconcile
sunsingerus Apr 24, 2026
672bb12
dev: zookeeper nodes comparator and accessors
sunsingerus Apr 24, 2026
e8b044c
dev: formatter
sunsingerus Apr 24, 2026
c0e2143
dev: elborate on chk reconcile dependencies
sunsingerus Apr 24, 2026
75dcc1f
dev: introduce referenced CHK reconcile metrics
sunsingerus Apr 24, 2026
84f00fc
dev: metrics api functions
sunsingerus Apr 24, 2026
0a6118b
dev: watch pod statuses
sunsingerus Apr 24, 2026
c7091b7
dev: clarify keeper resolver
sunsingerus Apr 24, 2026
85715fb
dev: new emitted events
sunsingerus Apr 24, 2026
f9a7760
dev: chop config recovery section
sunsingerus Apr 24, 2026
5eba635
dev: crd recovery section
sunsingerus Apr 24, 2026
e87d699
dev: controller keeper resolver functions
sunsingerus Apr 24, 2026
528a65f
dev: retry recovery
sunsingerus Apr 24, 2026
c0478b1
dev: unit tests runner
sunsingerus Apr 24, 2026
84c43b4
env: config
sunsingerus Apr 24, 2026
f8db54b
dev: test 35 manifests
sunsingerus Apr 24, 2026
3a10a17
test: adjust flow
sunsingerus Apr 24, 2026
3d460f1
dev: unit tests
sunsingerus Apr 24, 2026
9735f41
env: manifests
sunsingerus Apr 24, 2026
cedd718
env: helm chart
sunsingerus Apr 24, 2026
cb440b9
dev: merge
sunsingerus Apr 24, 2026
1f4115b
Merge pull request #1966 from Altinity/fix/secret-backed-upgrade-rollout
sunsingerus Apr 24, 2026
51a1877
Merge branch '0.27.0' of https://github.com/Altinity/clickhouse-opera…
sunsingerus Apr 24, 2026
5a31420
Update k8s.io/client-go to version 0.30.14
dcoppa Apr 26, 2026
50450b5
dev: work on long env propagation
sunsingerus Apr 27, 2026
644a622
dev: test
sunsingerus Apr 27, 2026
bf0699f
Port dev/run_code_generator.sh to kube_codegen.sh and fix deepcopy ga…
dcoppa Apr 28, 2026
8cc932e
Improved test for CHI auto recovery
alex-zaitsev Apr 28, 2026
77e32c4
dev: inherit into cluster cluster-level hooks from root
sunsingerus Apr 29, 2026
d128b7e
dev: fix typos
sunsingerus Apr 29, 2026
d3eeb5e
fix(chk): prevent nil pointer panic in poll when CR Get fails
wucm667 Apr 29, 2026
7cd0da3
dev: work on hooks typing
sunsingerus Apr 29, 2026
9c2d980
dev: unit tests
sunsingerus Apr 29, 2026
59b6df4
dev: polish hook types
sunsingerus Apr 29, 2026
1fb8acf
dev: unit test
sunsingerus Apr 29, 2026
0edc39a
dev: generic comparator
sunsingerus Apr 29, 2026
3bebfd3
dev: switch zk to common comparator
sunsingerus Apr 29, 2026
17e6e5e
dev: add string comparator
sunsingerus Apr 29, 2026
581b83a
dev: add cluster reconsile to top-level setup
sunsingerus Apr 29, 2026
536c6dd
dev: manifests
sunsingerus Apr 29, 2026
dedc0fe
env: helm chart
sunsingerus Apr 29, 2026
c328014
dev: rework hooks spec
sunsingerus Apr 29, 2026
2e9c36b
dev: accept both pascal case and all-lowers syntax
sunsingerus Apr 29, 2026
61dceaf
dev: normalization
sunsingerus Apr 30, 2026
e31eee0
dev: hook types
sunsingerus Apr 30, 2026
525bc50
dev: hook events listers
sunsingerus Apr 30, 2026
1bd129f
excludeMetricsRegexp -- filter out noise metrice, e,g CPU and OS
alex-zaitsev Apr 30, 2026
ae80f9f
dev: intorduce pre-delete hooks on host
sunsingerus Apr 30, 2026
c4b5682
dev: generic container
sunsingerus Apr 30, 2026
f1976ee
dev: add pre-delete hooks on hosts to be purged
sunsingerus Apr 30, 2026
05ca372
dev: add function to check whether there is at least one running host…
sunsingerus Apr 30, 2026
6fa3810
dev: hooks processor
sunsingerus Apr 30, 2026
55d931a
doc: max example
sunsingerus Apr 30, 2026
060fae3
doc: hooks examples
sunsingerus Apr 30, 2026
7fe767a
test: reconcile hooks with explicit evet targeting
sunsingerus Apr 30, 2026
072a974
dev: copiers
sunsingerus Apr 30, 2026
a30dc32
env: manifests
sunsingerus Apr 30, 2026
d1248c8
env: helm charts
sunsingerus Apr 30, 2026
9380072
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 30, 2026
73add78
dev: fold equality
sunsingerus Apr 30, 2026
0bd809c
dev: clarifications
sunsingerus Apr 30, 2026
bb4cec7
dev: unit tests
sunsingerus Apr 30, 2026
99704d9
dev: enhanse host handler by cluster name
sunsingerus Apr 30, 2026
e03f659
Tweak running tests to prevent excessive pulls
alex-zaitsev Apr 30, 2026
fb811bc
dev: clarify
sunsingerus Apr 30, 2026
dfcb6c0
dev: small fixes upon tests
sunsingerus Apr 30, 2026
26bd6cc
dev: unit tests
sunsingerus Apr 30, 2026
994adf3
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus Apr 30, 2026
42e49ca
feat(helm): allow readiness and liveness probes for operator containers
janeklb May 1, 2026
828cfcc
Merge pull request #1974 from wucm667/fix/chk-poll-nil-crash
sunsingerus May 4, 2026
096b033
Merge PR #1970 (k8s.io/client-go 0.29 → 0.30) into 0.27.0
sunsingerus May 4, 2026
f85247f
dev: switch back to type aliases
sunsingerus May 4, 2026
6c11779
dev: code generator
sunsingerus May 4, 2026
959e345
dev: k8s client lib mirgation clarification
sunsingerus May 4, 2026
02f599b
dev: suppress gengo noise
sunsingerus May 4, 2026
babcc45
dev: fix exported label
sunsingerus May 4, 2026
82d84bf
test: adjust label
sunsingerus May 4, 2026
7f0f7f7
Merge pull request #1965 from lukas-pfannschmidt-tr/fix/schema-discov…
sunsingerus May 4, 2026
1a9d660
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus May 4, 2026
8a420df
env: CI retries
sunsingerus May 5, 2026
2dfb81a
test: explicit timeout
sunsingerus May 5, 2026
dacf2ef
dev: tighten fileting expression
sunsingerus May 5, 2026
4371742
test: clarification
sunsingerus May 5, 2026
20fc829
dev: code clarification
sunsingerus May 5, 2026
6318792
Merge pull request #1976 from janeklb/jlb/readiness-liveness-probes
sunsingerus May 5, 2026
ce4b9a0
Merge remote-tracking branch 'altinity/0.27.0' into 0.27.0
sunsingerus May 5, 2026
35fe543
dev: helm chart
sunsingerus May 5, 2026
09abdb9
dev: default namespace config
sunsingerus May 5, 2026
d1fe8e4
dev: config
sunsingerus May 5, 2026
470f1d2
dev: manifests
sunsingerus May 5, 2026
281c186
dev: helm chart
sunsingerus May 5, 2026
1a1bea1
dev: clarify namespace description
sunsingerus May 6, 2026
66b93c1
dev: configs
sunsingerus May 6, 2026
dedb3cb
dev: clarify process
sunsingerus May 6, 2026
57516d4
dev: clarify hooks
sunsingerus May 6, 2026
bea3d63
dev: clarify poller
sunsingerus May 6, 2026
f127284
dev: explain namespaces in chop config example
sunsingerus May 6, 2026
3cd2625
dev: explain about direct migration from 0.23 version
sunsingerus May 6, 2026
5bf81f3
test: remove direct migration from 0.23
sunsingerus May 6, 2026
b71c23c
dev: manifests
sunsingerus May 6, 2026
07b17e5
dev: helm chart
sunsingerus May 6, 2026
c2d1ac5
dev: clarifications
sunsingerus May 6, 2026
22ca3d3
docs: upgrade paths
sunsingerus May 6, 2026
5bb290f
dev: rewrite probe to be ruok
sunsingerus May 6, 2026
64fa9fe
dev: wait for startup probe
sunsingerus May 6, 2026
c12d9ff
dev: explicitly add 4 letter commands white list
sunsingerus May 6, 2026
2cde85d
docs: probe note
sunsingerus May 6, 2026
712d8f8
dev: config
sunsingerus May 6, 2026
44febe1
env manifests
sunsingerus May 6, 2026
6f7cbcf
dev: helm
sunsingerus May 6, 2026
da3337a
Merge branch 'pr-1975' into 0.27.0
sunsingerus May 6, 2026
40ff27a
dev: exptact clickhouse metrics type separately
sunsingerus May 7, 2026
bf32a73
dev: extract metrics fileter as explicit interface
sunsingerus May 7, 2026
ebe474f
dev: move metrics filter into prometheus writer
sunsingerus May 7, 2026
5318731
dev: add unit tests
sunsingerus May 7, 2026
33cfa41
dev: rewrite metrics fetcher
sunsingerus May 7, 2026
29a3ff9
dev: wire exporter and filters
sunsingerus May 7, 2026
1d374e1
dev: implement regexp filters
sunsingerus May 7, 2026
eb0b48c
dev: minor clarification
sunsingerus May 7, 2026
0d9f0ed
dev: code generator
sunsingerus May 7, 2026
7ae9e78
dev: regenerate manifests for excludeRegexp rename
sunsingerus May 7, 2026
4d40dee
dev: fix MetricsFilter assertion typo
sunsingerus May 7, 2026
1492323
docs: excludeRegexp example and 0.27.0 metrics note
sunsingerus May 7, 2026
e4f6373
test: bump test_010051 wait timeout for slow CI
sunsingerus May 7, 2026
4444a44
dev: explanation
sunsingerus May 7, 2026
21de412
doc: example
sunsingerus May 7, 2026
47bbdd6
doc: upgrade manual
sunsingerus May 7, 2026
8d6eb22
test: explanations
sunsingerus May 7, 2026
43f9549
dev: config
sunsingerus May 7, 2026
eb1e9b4
env: manifests
sunsingerus May 7, 2026
ce2f20e
env: helm chart
sunsingerus May 7, 2026
aa057aa
fix: use plain errors for clickhouse model messages (#1980)
immanuwell May 8, 2026
d7945c1
Fix CHK deletion panic
alex-zaitsev May 8, 2026
0069fdf
env: hub manifests
sunsingerus May 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
run_tests:
name: Run Tests
runs-on: ubuntu-latest
timeout-minutes: 300
steps:
- uses: actions/checkout@v4
- name: Cache python
Expand Down Expand Up @@ -67,6 +68,8 @@ jobs:

minikube image load operator.tar
minikube image load metrics-exporter.tar
minikube image ls | grep -F "docker.io/altinity/clickhouse-operator:${CHO_RELEASE}"
minikube image ls | grep -F "docker.io/altinity/metrics-exporter:${CHO_RELEASE}"

- name: Deploy prometheus
run: |
Expand Down Expand Up @@ -95,6 +98,9 @@ jobs:
set +e # disable the "exit on failure"

sudo ln -snvf ~/venv/qa/bin/tfs /bin/tfs
export IMAGE_PULL_POLICY="IfNotPresent"
echo " image pull policy: ${IMAGE_PULL_POLICY}"
echo

if [[ "${{ github.event.inputs.test_mask }}" != '' ]]
then
Expand All @@ -108,7 +114,13 @@ jobs:
test_mode="--test-to-end"
fi

~/venv/qa/bin/python3 ./tests/regression.py -- $test_mode --trim-results on -o short --no-colors --native --log ./tests/raw.log
# Skip retries when test_mask selects a specific test — retries mask real bugs during debugging.
retry_args=()
if [[ -z "${{ github.event.inputs.test_mask }}" ]]; then
retry_args+=(--retry "/regression/e2e.test_operator/test_0:,5,,30")
fi

~/venv/qa/bin/python3 ./tests/regression.py -- $test_mode "${retry_args[@]}" --trim-results on -o short --no-colors --native --log ./tests/raw.log
test_result=$?
~/venv/qa/bin/tfs --no-colors transform compact ./tests/raw.log ./tests/compact.log
~/venv/qa/bin/tfs --no-colors transform nice ./tests/raw.log ./tests/nice.log.txt
Expand Down
4 changes: 2 additions & 2 deletions cmd/metrics_exporter/app/metrics_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"flag"
"fmt"
"github.com/altinity/clickhouse-operator/pkg/metrics/clickhouse"
"os"
"os/signal"
"syscall"
Expand All @@ -27,6 +26,7 @@ import (
// log "k8s.io/klog"

"github.com/altinity/clickhouse-operator/pkg/chop"
"github.com/altinity/clickhouse-operator/pkg/metrics/clickhouse"
"github.com/altinity/clickhouse-operator/pkg/version"
)

Expand Down Expand Up @@ -90,7 +90,7 @@ func Run() {
log.Infof("Starting metrics exporter. Version:%s GitSHA:%s BuiltAt:%s\n", version.Version, version.GitSHA, version.BuiltAt)

// Initialize k8s API clients
kubeClient, _, chopClient := chop.GetClientset(kubeConfigFile, masterURL)
kubeClient, _, chopClient, _ := chop.GetClientset(kubeConfigFile, masterURL)

// Create operator instance
chop.New(kubeClient, chopClient, chopConfigFile)
Expand Down
18 changes: 17 additions & 1 deletion cmd/operator/app/thread_chi.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@ func initClickHouse(ctx context.Context) {
}

// Initialize k8s API clients
kubeClient, extClient, chopClient := chop.GetClientset(kubeConfigFile, masterURL)
kubeClient, extClient, chopClient, dynamicClient := chop.GetClientset(kubeConfigFile, masterURL)

// Create operator instance
chop.New(kubeClient, chopClient, chopConfigFile)
log.V(1).F().Info("Config parsed:")
log.Info("\n" + chop.Config().String(true))
if chop.Config().RestartOnOperatorConfigurationChange() {
log.Info("Auto-restart on ClickHouseOperatorConfiguration change is enabled")
} else {
log.Info("Auto-restart on ClickHouseOperatorConfiguration change is disabled")
}

// Log namespace deny list configuration
if chop.Config().Watch.Namespaces.Exclude.Len() > 0 {
Expand All @@ -81,19 +86,30 @@ func initClickHouse(ctx context.Context) {
chopInformerFactoryResyncPeriod,
chopinformers.WithNamespace(chop.Config().GetInformerNamespace()),
)
chopConfigInformerFactory := chopinformers.NewSharedInformerFactoryWithOptions(
chopClient,
chopInformerFactoryResyncPeriod,
chopinformers.WithNamespace(chop.Config().Runtime.Namespace),
)

// Create Controller
chiController = chi.NewController(
chopClient,
extClient,
kubeClient,
dynamicClient,
chopConfigInformerFactory,
chopInformerFactory,
kubeInformerFactory,
)

// Start CHK watcher (if enabled by config)
chiController.StartCHKWatcher(ctx)

// Start Informers
kubeInformerFactory.Start(ctx.Done())
chopInformerFactory.Start(ctx.Done())
chopConfigInformerFactory.Start(ctx.Done())
}

// runClickHouse is an entry point of the application
Expand Down
8 changes: 6 additions & 2 deletions cmd/operator/app/thread_keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ func initKeeper(ctx context.Context) error {
return err
}

defaultNamespaces := make(map[string]cache.Config)
for _, ns := range chop.Config().GetCacheNamespaces() {
defaultNamespaces[ns] = cache.Config{}
}
manager, err = ctrlRuntime.NewManager(ctrlRuntime.GetConfigOrDie(), ctrlRuntime.Options{
Scheme: scheme,
Cache: cache.Options{
// GetCacheNamespaces returns exact namespace names when all configured watch namespaces are
// valid DNS labels, enabling per-namespace cache scoping. Falls back to NamespaceAll when
// any watch namespace is a regexp pattern (the controller's Reconcile guard handles filtering
// in that case).
Namespaces: chop.Config().GetCacheNamespaces(),
DefaultNamespaces: defaultNamespaces,
},
})
if err != nil {
Expand All @@ -63,7 +67,7 @@ func initKeeper(ctx context.Context) error {

// Build the apiextensions client for CRD deletion checks during CHK cleanup.
// Uses the same kubeConfigFile/masterURL package vars as the CHI thread.
_, extClient, _ := chop.GetClientset(kubeConfigFile, masterURL)
_, extClient, _, _ := chop.GetClientset(kubeConfigFile, masterURL)

err = ctrlRuntime.
NewControllerManagedBy(manager).
Expand Down
34 changes: 23 additions & 11 deletions cmd/operator/app/thread_keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,48 @@ package app
import (
"testing"

"github.com/altinity/clickhouse-operator/pkg/apis/common/types"
"sigs.k8s.io/controller-runtime/pkg/event"

api "github.com/altinity/clickhouse-operator/pkg/apis/clickhouse-keeper.altinity.com/v1"
"github.com/altinity/clickhouse-operator/pkg/apis/common/types"
"github.com/altinity/clickhouse-operator/pkg/chop"
)

func init() {
// keeperPredicate() → ShouldEnqueue() → chop.Config().IsNamespaceWatched(...),
// so the global chop singleton must be initialized before tests run.
chop.New(nil, nil, "")
}

// keeperPredicate intentionally does NOT pre-filter on Spec.Suspend (mirrors the
// behavior of pkg/controller/chi/ShouldEnqueue). The CHK reconciler handles suspend
// itself; pre-filtering at the informer level would prevent the reconciler from
// observing suspend-driven state transitions.

func Test_keeperPredicateCreate(t *testing.T) {
tests := []struct {
name string
want bool
evt event.CreateEvent
}{
{
name: "skips create when suspended",
want: false,
name: "queues create for a non-suspended CHK",
want: true,
evt: event.CreateEvent{
Object: &api.ClickHouseKeeperInstallation{
Spec: api.ChkSpec{
Suspend: types.NewStringBool(true),
Suspend: types.NewStringBool(false),
},
},
},
},
{
name: "queues create when not suspended",
name: "queues create even when suspended (reconciler handles suspend)",
want: true,
evt: event.CreateEvent{
Object: &api.ClickHouseKeeperInstallation{
Spec: api.ChkSpec{
Suspend: types.NewStringBool(false),
Suspend: types.NewStringBool(true),
},
},
},
Expand All @@ -55,23 +67,23 @@ func Test_keeperPredicateUpdate(t *testing.T) {
evt event.UpdateEvent
}{
{
name: "skips update when suspended",
want: false,
name: "queues update for a non-suspended CHK",
want: true,
evt: event.UpdateEvent{
ObjectNew: &api.ClickHouseKeeperInstallation{
Spec: api.ChkSpec{
Suspend: types.NewStringBool(true),
Suspend: types.NewStringBool(false),
},
},
},
},
{
name: "queues update when not suspended",
name: "queues update even when suspended (reconciler handles suspend)",
want: true,
evt: event.UpdateEvent{
ObjectNew: &api.ClickHouseKeeperInstallation{
Spec: api.ChkSpec{
Suspend: types.NewStringBool(false),
Suspend: types.NewStringBool(true),
},
},
},
Expand Down
18 changes: 18 additions & 0 deletions config/chk/keeper_config.d/01-keeper-01-default-config.xml
Original file line number< 10BC8 /th> Diff line number Diff line change
Expand Up @@ -8,16 +8,34 @@
<asynchronous_metrics_keeper_metrics_only>1</asynchronous_metrics_keeper_metrics_only>
<keeper_server>
<coordination_settings>
<async_replication>1</async_replication>
<min_session_timeout_ms>10000</min_session_timeout_ms>
<operation_timeout_ms>10000</operation_timeout_ms>
<raft_logs_level>information</raft_logs_level>
<session_timeout_ms>100000</session_timeout_ms>
<use_xid_64>1</use_xid_64>
</coordination_settings>
<hostname_checks_enabled>true</hostname_checks_enabled>
<log_storage_path>/var/lib/clickhouse-keeper/coordination/logs</log_storage_path>
<snapshot_storage_path>/var/lib/clickhouse-keeper/coordination/snapshots</snapshot_storage_path>
<storage_path>/var/lib/clickhouse-keeper</storage_path>
<tcp_port>2181</tcp_port>
<!--
Four-letter-word command allowlist.

Set explicitly to the upstream-default list so the operator-rendered
liveness probe (which sends `ruok` over TCP and expects `imok`) keeps
working even if a user adds their own keeper_server settings.

Without this, a user override that restricts the allowlist
(e.g. `four_letter_word_white_list: "mntr,stat"` for security)
would silently disable `ruok` → liveness probe always fails → CrashLoopBackOff.

The list mirrors ClickHouse Keeper's compiled-in default; users who want a
stricter list can override this value, but they must keep `ruok` if they
also use the default operator probes.
-->
<four_letter_word_white_list>conf,cons,crst,envi,ruok,srst,srvr,stat,wchs,dirs,mntr,isro</four_letter_word_white_list>
</keeper_server>
<listen_host>::</listen_host>
<listen_host>0.0.0.0</listen_host>
Expand Down
72 changes: 68 additions & 4 deletions config/config-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@
##
################################################
watch:
# List of namespaces where clickhouse-operator watches for events.
# Namespaces where clickhouse-operator watches for events.
# Concurrently running operators should watch on different namespaces.
# IMPORTANT
# Regexp is applicable.
# `include` and `exclude` accept literal namespace names or regexp patterns.
# Empty `include` watches the operator's own namespace (or all namespaces when
# the operator runs in `kube-system`); use [".*"] to force watch-all elsewhere.
# Empty `exclude` matches none. `exclude` is applied after `include`.
namespaces:
include: [dev, test]
exclude: []

# Behavior when ClickHouseOperatorConfiguration changes: none | restart
configuration:
onChange: restart

clickhouse:
configuration:
################################################
Expand Down Expand Up @@ -218,7 +224,6 @@ clickhouse:
quotas:
settings:
files:

- version: ">= 23.5"
spec:
configuration:
Expand Down Expand Up @@ -411,6 +416,65 @@ reconcile:
# Whether the operator during reconcile procedure should drop active replicas when replica is deleted or recreated
active: no

################################################
##
## Coordination with external systems during reconcile
##
################################################
coordination:
keeper:
# How long the operator waits for a referenced ClickHouseKeeper to become ready
# before aborting CHI reconcile. In seconds.
readyTimeout: 120
# Reaction when a referenced CHK resource changes:
# none — do nothing (default, backward-compatible)
# reconcile — trigger CHI reconcile
# onKeeperResourceUpdate: none

################################################
##
## Auto-recovery from aborted reconcile
##
################################################
recovery:
# Recovery scopes keyed by CHI state being recovered from.
# Each scope contains on<Event>: <action> mappings that apply while the CHI
# is in that state. Multi-scope design anticipates future states beyond Aborted
# (e.g. Failed, Broken).
from:
# Recovery from Status=Aborted
aborted:
# Action when a pod belonging to an Aborted CHI transitions to Ready:
# retry (default) — re-enqueue the CHI for reconcile
# none — do nothing, CHI stays Aborted
onPodReady: retry
# Future events (not yet implemented):
# onKeeperReady: retry — retry when a referenced CHK becomes ready
# onOperatorRestart: retry — sweep Aborted CHIs on operator startup
# Future scopes (not yet implemented):
# failed:
# onPodReady: retry
# broken:
# onPodReady: retry

# Future global policy knobs (not yet implemented) — flat peers of `from`,
# apply across all recovery scopes:
#
# Global kill-switch for auto-recovery:
# enabled: true
#
# Cap on consecutive auto-recovery attempts before giving up:
# retries: 5
#
# Minimum time between auto-recovery attempts for the same CHI:
# cooldown: 30s
#
# Exponential backoff for auto-recovery attempts:
# backoff:
# duration: 5s
# factor: 2
# maxDuration: 2m

################################################
##
## Annotations management section
Expand Down
Loading
Loading
0