Altinity / Altinity/clickhouse-operator

Add CHI-scope lifecycle hooks for reconcile transitions

Open
#2,012 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.6k
Forks
574
Avg merge
8d 6h
Merged PRs (30d)
6

Description

The operator already exposes CHI reconcile lifecycle through status updates and Kubernetes Events, but the hook subsystem cannot react at CHI scope. Hooks exist only at host and cluster scope, so there is currently no native way to run logic once per whole-CHI reconcile cycle.

This issue proposes adding CHI-scope lifecycle hooks so users can attach automation to reconcile transitions such as start, successful completion, and failure.

  • Hooks exist, but only at host and cluster scope. There is no CHI-scope event model in type_hooks.go.
  • CHI lifecycle transitions already exist through status (InProgress, Completed, Aborted, Terminating) in type_status.go.
  • The worker already emits CHI-scoped events such as ReconcileStarted and ReconcileCompleted.
Example use cases

Without CHI-scope hooks, users who need automation around maintenance or reconcile windows have to build and operate an external watcher/controller around .status.status or Kubernetes Events.

  • Suspend backup CronJobs before a CHI upgrade or rolling maintenance and resume them only after the CHI returns to stable Completed.
  • Trigger external maintenance windows or alerts once per CHI reconcile cycle instead of once per host.
  • Coordinate follow-up validation or post-reconcile actions after a full CHI rollout finishes.

cc: @sunsingerus

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing hook definitions in pkg/apis/clickhouse.altinity.com/v1/type_hooks.go and lifecycle states in type_status.go. Trace CHI reconcile events from pkg/controller/chi/worker.go and the event emitter, then compare existing host- and cluster-scope hook behavior. Done means CHI-scope hooks cover the proposed reconcile transitions and run once per whole-CHI cycle.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.