Skip to content

Commit 67221b5

Browse files
docs: fix docs links and CI, fetch mintlify changes, actualize some docs and comments
1 parent 8381d0c commit 67221b5

23 files changed

Lines changed: 122 additions & 84 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,27 @@ permissions:
1313
pull-requests: write
1414

1515
jobs:
16+
changes:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
code: ${{ steps.filter.outputs.code }}
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v6
23+
- name: Detect non-docs changes
24+
uses: dorny/paths-filter@v3
25+
id: filter
26+
with:
27+
filters: |
28+
code:
29+
- '**'
30+
- '!**/*.md'
31+
- '!**/*.mdx'
32+
1633
lint:
1734
runs-on: ubuntu-latest
35+
needs: [ changes ]
36+
if: needs.changes.outputs.code == 'true'
1837
steps:
1938
- name: Checkout code
2039
uses: actions/checkout@v6
@@ -55,7 +74,9 @@ jobs:
5574
# Only run on pull requests, and skip when the PR is explicitly labeled as
5675
# an intentional CRD-breaking change. The job is not part of ci-success-check,
5776
# so a failure here does not block the aggregate gate.
77+
needs: [ changes ]
5878
if: |
79+
needs.changes.outputs.code == 'true' &&
5980
github.event_name == 'pull_request' &&
6081
!contains(github.event.pull_request.labels.*.name, 'crd-breaking-change')
6182
runs-on: ubuntu-latest
@@ -75,6 +96,8 @@ jobs:
7596

7697
bundle:
7798
runs-on: ubuntu-latest
99+
needs: [ changes ]
100+
if: needs.changes.outputs.code == 'true'
78101
env:
79102
VERSION: 0.0.1
80103
steps:
@@ -109,6 +132,8 @@ jobs:
109132

110133
build_and_test:
111134
runs-on: ubuntu-latest
135+
needs: [ changes ]
136+
if: needs.changes.outputs.code == 'true'
112137
steps:
113138
- name: Checkout code
114139
uses: actions/checkout@v6
@@ -143,6 +168,8 @@ jobs:
143168

144169
fuzz_specs:
145170
runs-on: ubuntu-latest
171+
needs: [ changes ]
172+
if: needs.changes.outputs.code == 'true'
146173
steps:
147174
- name: Checkout code
148175
uses: actions/checkout@v6
@@ -160,6 +187,8 @@ jobs:
160187

161188
helm-test:
162189
runs-on: ubuntu-latest
190+
needs: [ changes ]
191+
if: needs.changes.outputs.code == 'true'
163192
steps:
164193
- name: Checkout code
165194
uses: actions/checkout@v6
@@ -189,6 +218,8 @@ jobs:
189218

190219
compat-e2e-test:
191220
runs-on: [ubuntu-latest]
221+
needs: [ changes ]
222+
if: needs.changes.outputs.code == 'true'
192223
strategy:
193224
fail-fast: false
194225
matrix:
@@ -259,7 +290,8 @@ jobs:
259290
overwrite: true
260291

261292
e2e-test:
262-
needs: [ lint ]
293+
needs: [ lint, changes ]
294+
if: needs.changes.outputs.code == 'true'
263295
strategy:
264296
fail-fast: false
265297
matrix:
@@ -301,9 +333,9 @@ jobs:
301333
overwrite: true
302334

303335
e2e-report:
304-
needs: [compat-e2e-test, e2e-test]
336+
needs: [ changes, compat-e2e-test, e2e-test ]
305337
runs-on: ubuntu-latest
306-
if: ${{ !cancelled() }}
338+
if: ${{ !cancelled() && needs.changes.outputs.code == 'true' }}
307339
steps:
308340
- name: Checkout code
309341
uses: actions/checkout@v6
@@ -325,8 +357,10 @@ jobs:
325357
path: "**/*-report.xml"
326358

327359
openshift-compat:
328-
needs: [ compat-e2e-test, e2e-test ]
329-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
360+
needs: [ changes, compat-e2e-test, e2e-test ]
361+
if: |
362+
needs.changes.outputs.code == 'true' &&
363+
( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository )
330364
runs-on: [self-hosted, openshift, operator]
331365
continue-on-error: true
332366
timeout-minutes: 60
@@ -390,7 +424,7 @@ jobs:
390424
ci-success-check:
391425
name: All CI checks passed
392426
runs-on: ubuntu-latest
393-
needs: [ lint, bundle, build_and_test, fuzz_specs, helm-test, compat-e2e-test, e2e-test, check-crd-compat ]
427+
needs: [ changes, lint, bundle, build_and_test, fuzz_specs, helm-test, compat-e2e-test, e2e-test, check-crd-compat ]
394428
if: always()
395429
steps:
396430
- name: Determine CI status

.github/workflows/docs-lint.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,19 @@ jobs:
2222
fail_on_error: 'true'
2323
filter_mode: nofilter
2424

25-
markdown-link-check:
25+
doc-links:
26+
name: Doc links
2627
runs-on: ubuntu-latest
2728
steps:
2829
- uses: actions/checkout@v6
29-
- uses: UmbrellaDocs/action-linkspector@v1
30+
- uses: dorny/paths-filter@v3
31+
id: changes
32+
with:
33+
filters: |
34+
docs:
35+
- 'docs/**'
36+
- if: steps.changes.outputs.docs == 'true'
37+
uses: UmbrellaDocs/action-linkspector@v1
3038
with:
3139
github_token: ${{ secrets.GITHUB_TOKEN }}
3240
reporter: github-pr-review
@@ -54,7 +62,7 @@ jobs:
5462
ci-success-check:
5563
name: All Docs CI checks passed
5664
runs-on: ubuntu-latest
57-
needs: [ vale, markdown-link-check, api-reference-generated ]
65+
needs: [ vale, doc-links, api-reference-generated ]
5866
if: always()
5967
steps:
6068
- name: Determine CI status

.linkspector.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
# Link check for the docs/ tree. Run from the repo root so the self-link
2+
# rewrite resolves against the local source.
3+
# - relative + external links: checked normally
4+
# - operator self-links (/products/kubernetes-operator/...): resolved against
5+
# the local docs/ source, including anchors
6+
# - other Mintlify site-absolute links (/reference, /concepts, ...): resolved
7+
# against ClickHouse/mintlify-docs-dev main via raw GitHub (page existence;
8+
# anchors are not checked over HTTP)
19
dirs:
2-
- .
3-
useGitIgnore: true
10+
- docs
11+
useGitIgnore: false
412
fileExtensions:
513
- md
614
- mdx
7-
excludedDirs:
8-
- ./node_modules
9-
- ./bin
10-
- ./dist
11-
15+
replacementPatterns:
16+
- pattern: '^/products/kubernetes-operator/(.+?)(#.*)?$'
17+
replacement: '/docs/$1.mdx$2'
18+
- pattern: '^/(?!docs/)([^#]+?)(#.*)?$'
19+
replacement: 'https://raw.githubusercontent.com/ClickHouse/mintlify-docs-dev/main/$1.mdx'
1220
ignorePatterns:
13-
# Mintlify absolute routes — resolved at deploy time by Mintlify,
14-
# not present as files in this repo.
15-
- pattern: '^/(products|core|cloud|operations)/'
16-
# Cloudflare bot protection returns 403 to programmatic checkers.
21+
- pattern: '^/(_site|images|assets)/'
1722
- pattern: '^https://trust\.clickhouse\.com'

AGENTS.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,23 @@ After modifying types, always run `make generate manifests generate-helmchart-ci
105105
### Controllers (`internal/controller/`)
106106
Both controllers follow the same pattern, extending a shared base:
107107

108-
- `reconcilerbase.go`Base reconciliation logic shared by both controllers
108+
- `step.go`ReconcileStep pipeline primitives (StepResult, RunSteps)
109109
- `clickhouse/controller.go` — ClickHouseCluster reconciler (manages StatefulSets, ConfigMaps, Services)
110110
- `keeper/controller.go` — KeeperCluster reconciler
111-
- `clickhouse/sync.go`, `keeper/sync.go`Sync desired state to Kubernetes
111+
- `clickhouse/sync.go`, `keeper/sync.go`Build the step pipeline; sync desired state to Kubernetes
112112
- `clickhouse/templates.go`, `keeper/templates.go` — Generate Kubernetes resource specs
113113
- `clickhouse/config.go` — Generate ClickHouse YAML configuration
114114
- `clickhouse/commands.go`, `keeper/commands.go` — Interfaces to communicate to running containers
115115
- `overrides.go` — Pod/container spec overrides helpers via strategic merge patch
116116
- `versionprobe.go` — Creates Jobs to detect actual ClickHouse/Keeper versions
117117
- `upgradecheck.go` — Checks for newer version availability
118-
- `resources.go` — Shared Kubernetes resource creation helpers
119-
- `status.go` — Status update logic
118+
- `resourcemanager.go` — Shared Kubernetes resource create/update with spec-hash idempotency
119+
- `statusmanager.go` — Status/condition manager (retry-on-conflict, events on transition)
120+
- `replicastate.go` — Per-replica readiness / rolling-update state
121+
- `securitycontext.go` — Pod/container SecurityContext defaults
120122

121123
### Reconciliation Pattern
122-
Controllers execute reconcile as a sequence of step functions (`func(ctx, log) (*Result, error)`). Steps are defined in `sync()` and executed sequentially.
124+
`sync()` builds an ordered `[]ReconcileStep` (see `step.go`), executed by `RunSteps`. Each step's `Fn` is `func(ctx, log) (StepResult, error)`. `StepResult{RequeueAfter, Blocked}` controls flow: `Blocked=true` is a *valid wait* (e.g. version-probe Job not finished) — return it, not an error; it skips subsequent non-`Always` steps. Steps with `Always: true` run even while the pipeline is blocked. `RunSteps` returns the minimum `RequeueAfter`; the first error aborts.
123125

124126
### Resource Change Detection
125127
Resources are tracked via annotation hashes (`checksum/spec`, `checksum/configuration`). Before updating a K8s resource, compare `util.DeepHashResource()` output against the stored annotation. Skip updates when hashes match. Always call `util.AddSpecHashToObject()` on reconciled resources.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The Operator handles the full lifecycle of ClickHouse clusters, including scalin
2929
## Getting Started
3030

3131
### Prerequisites
32-
- go version v1.25.0+
32+
- go version v1.26.0+
3333
- docker version 17.03+
3434
- `kubectl` version v1.28.0+
3535
- Access to a Kubernetes v1.28.0+ cluster

api/v1alpha1/keepercluster_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type KeeperClusterSpec struct {
4646

4747
// PodDisruptionBudget configures the PDB created for the Keeper cluster.
4848
// When unset, the operator defaults to maxUnavailable=replicas/2
49-
// (preserving quorum for a 2F+1 cluster).
49+
// (preserving quorum for a 2F+1 cluster); single-replica clusters use maxUnavailable=1.
5050
// +optional
5151
PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
5252

@@ -155,7 +155,7 @@ type KeeperClusterStatus struct {
155155
// CurrentRevision indicates latest applied KeeperCluster spec revision.
156156
// +operator-sdk:csv:customresourcedefinitions:type=status
157157
CurrentRevision string `json:"currentRevision,omitempty"`
158-
// CurrentRevision indicates latest requested KeeperCluster spec revision.
158+
// UpdateRevision indicates latest requested KeeperCluster spec revision.
159159
// +operator-sdk:csv:customresourcedefinitions:type=status
160160
UpdateRevision string `json:"updateRevision,omitempty"`
161161
// ObservedGeneration indicates latest generation observed by controller.

config/crd/bases/clickhouse.com_keeperclusters.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ spec:
10991099
description: |-
11001100
PodDisruptionBudget configures the PDB created for the Keeper cluster.
11011101
When unset, the operator defaults to maxUnavailable=replicas/2
1102-
(preserving quorum for a 2F+1 cluster).
1102+
(preserving quorum for a 2F+1 cluster); single-replica clusters use maxUnavailable=1.
11031103
properties:
11041104
maxUnavailable:
11051105
anyOf:
@@ -6865,7 +6865,7 @@ spec:
68656865
for every replica.
68666866
type: string
68676867
updateRevision:
6868-
description: CurrentRevision indicates latest requested KeeperCluster
6868+
description: UpdateRevision indicates latest requested KeeperCluster
68696869
spec revision.
68706870
type: string
68716871
version:

dist/chart-cluster/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ keeper:
139139

140140
# PodDisruptionBudget configures the PDB created for the Keeper cluster.
141141
# When unset, the operator defaults to maxUnavailable=replicas/2
142-
# (preserving quorum for a 2F+1 cluster).
142+
# (preserving quorum for a 2F+1 cluster); single-replica clusters use maxUnavailable=1.
143143
# podDisruptionBudget: {}
144144

145145
# Parameters passed to the Keeper pod spec.

dist/chart/templates/crd/keeperclusters.clickhouse.com.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ spec:
11021102
description: |-
11031103
PodDisruptionBudget configures the PDB created for the Keeper cluster.
11041104
When unset, the operator defaults to maxUnavailable=replicas/2
1105-
(preserving quorum for a 2F+1 cluster).
1105+
(preserving quorum for a 2F+1 cluster); single-replica clusters use maxUnavailable=1.
11061106
properties:
11071107
maxUnavailable:
11081108
anyOf:
@@ -6868,7 +6868,7 @@ spec:
68686868
for every replica.
68696869
type: string
68706870
updateRevision:
6871-
description: CurrentRevision indicates latest requested KeeperCluster
6871+
description: UpdateRevision indicates latest requested KeeperCluster
68726872
spec revision.
68736873
type: string
68746874
version:

docs/guides/configuration.mdx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
---
22
position: 2
33
slug: /clickhouse-operator/guides/configuration
4-
title: 'Configuration'
4+
title: ClickHouse Operator configuration guide
55
keywords: ['kubernetes']
66
description: 'This guide covers how to configure ClickHouse and Keeper clusters using the ClickHouse operator.'
77
doc_type: 'guide'
88
---
99

10-
# ClickHouse Operator configuration guide
11-
1210
This guide covers how to configure ClickHouse and Keeper clusters using the operator.
1311

1412
## ClickHouseCluster configuration {#clickhousecluster-configuration}
@@ -389,7 +387,7 @@ stringData:
389387

390388
| Policy | Behavior on missing keys |
391389
|---|---|
392-
| `Observe` (default) | Reconciliation is **blocked** until every required key is present. The operator reports each missing key — and the format hint for it — via the `ExternalSecretValid` status condition and a `Warning` event. |
390+
| `Observe` (default) | Reconciliation is **blocked** until every required key is present. The operator reports each missing key — and the format hint for it — via the `ExternalSecretValid` condition (with reason `ExternalSecretInvalid`) and a `Warning` event. |
393391
| `Manage` | The operator **generates** any missing required keys and writes them back to the same Secret. Useful for bootstrapping: create an empty Secret, let the operator fill it, then optionally tighten access. The operator still never deletes the Secret. |
394392

395393
<Note>
@@ -562,7 +560,7 @@ Two conditions surface the result of the probe and the upgrade check:
562560
| Condition | Reason | Meaning |
563561
|---|---|---|
564562
| `VersionInSync` | `VersionMatch` | All replicas report the same version as the image |
565-
| `VersionInSync` | `VersionMismatch` | Replicas are running different versions. This reason is suppressed during a planned rolling upgrade. It typically surfaces when a mutable image tag has been pinned (for example `latest` or a bare major like `26.3`) and the underlying registry has shifted between pulls, so different replicas ended up on different patches of the same tag. |
563+
| `VersionInSync` | `VersionMismatch` | Replicas are running different versions. The warning event is suppressed during a planned rolling upgrade. It typically surfaces when a mutable image tag has been pinned (for example `latest` or a bare major like `26.3`) and the underlying registry has shifted between pulls, so different replicas ended up on different patches of the same tag. |
566564
| `VersionInSync` | `VersionPending` | Version probe Job has not finished yet |
567565
| `VersionInSync` | `VersionProbeFailed` | Probe Job failed; the operator cannot determine the running version |
568566
| `VersionUpgraded` | `UpToDate` | The cluster is on the latest version available in the selected channel |
@@ -778,8 +776,8 @@ spec:
778776
```
779777

780778
#### Useful links:
781-
* [YAML configuration examples](/core/concepts/features/configuration/server-config/configuration-files#example-1)
782-
* [All server settings](/core/reference/settings/server-settings/settings)
779+
* [YAML configuration examples](/concepts/features/configuration/server-config/configuration-files#example-1)
780+
* [All server settings](/reference/settings/server-settings/settings)
783781

784782
### Embedded extra users configuration {#embedded-extra-users-configuration}
785783

@@ -811,7 +809,7 @@ spec:
811809
The `extraUsersConfig` is stored in k8s ConfigMap object. Avoid plain text secrets there.
812810
</Note>
813811

814-
#### See [documentation](/core/concepts/features/configuration/settings/settings-users) for all supported ClickHouse users configuration options.
812+
#### See [documentation](/concepts/features/configuration/settings/settings-users) for all supported ClickHouse users configuration options.
815813

816814
### Configuration example {#configuration-example}
817815

0 commit comments

Comments
 (0)