8000 Restart operator on operator configuration change by alex-zaitsev · Pull Request #1960 · Altinity/clickhouse-operator · GitHub
[go: up one dir, main page]

Skip to content

Restart operator on operator configuration change - #1960

Merged
sunsingerus merged 5 commits into
0.27.0from
fix/chop-config-restart-on-config-change
Apr 21, 2026
Merged

sunsingerus merged 5 commits into
0.27.0from
fix/chop-config-restart-on-config-change

Conversation

@alex-zaitsev
@alex-zaitsev alex-zaitsev commented Apr 17, 2026 •
Copy link
Copy Markdown
Member

Add operator config option to control if operator needs to be restarted on config changes or not. Enabled by default.

watch
  configuration:
    onChange: restart

Closes #1930

@sunsingerus
Copy link
Copy Markdown
Collaborator

Design feedback on the restart: config section

The feature itself is correct and needed — os.Exit(0) on config change is the standard Kubernetes operator pattern (cert-manager, prometheus-operator, Strimzi, Crossplane, Flux — all require pod restart for operator-level config changes).

However, the naming and framing of the config section could be improved.

Problem with restart:

  1. Too imperative — describes the mechanism (restart), not the intent (react to config change). If seamless hot-reload is implemented later, the field name becomes misleading.
  2. Too narrow — a restart section can only grow into more restart-related booleans. Dead-end namespace.
  3. Not how the ecosystem does it — the common pattern is policy/strategy enums, not boolean flags:
    • Spring Cloud K8s: reload.strategy: refresh | restart_context | shutdown
    • Prometheus Operator: --repair-policy: none | evict | delete
    • Percona Operator: updateStrategy: SmartUpdate | RollingUpdate | OnDelete
    • Kubernetes native: updateStrategy.type: RollingUpdate | OnDelete

Suggestion

Use a policy enum that describes the reaction, not the mechanism:

configuration:
  onConfigurationChange: restart    # none | restart (future: reload)

or, grouped under the existing watch section (since CHOPCONF is already watched):

watch:
  namespaces: []
  configuration:
    onChange: restart    # none | restart

The none/restart enum is trivially extensible to reload when hot-reload is implemented, without breaking the API. A boolean restartOnChange: true locks the API into a restart-or-not binary choice forever.

@sunsingerus sunsingerus added the planned for review This feature is planned for review label Apr 20, 2026
@alex-zaitsev
alex-zaitsev force-pushed the fix/chop-config-restart-on-config-change branch from 995f9b1 to b1af8bf Compare April 21, 2026 07:18
@sunsingerus
sunsingerus merged commit 9c40366 into 0.27.0 Apr 21, 2026
1 of 2 checks passed
@sunsingerus
sunsingerus deleted the fix/chop-config-restart-on-config-change branch June 4, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

planned for review This feature is planned for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0