8000 fix: add chi-/chk- prefixes to PDB names to prevent naming conflicts by karnzx · Pull Request #1838 · Altinity/clickhouse-operator · GitHub
[go: up one dir, main page]

Skip to content

fix: add chi-/chk- prefixes to PDB names to prevent naming conflicts - #1838

Closed
karnzx wants to merge 1 commit into
Altinity:masterfrom
karnzx:feat/pdb-prefix
Closed

karnzx wants to merge 1 commit into
Altinity:masterfrom
karnzx:feat/pdb-prefix

Conversation

@karnzx
@karnzx karnzx commented Oct 5, 2025
Copy link
Copy Markdown

Problem

When both ClickHouse Installation (CHI) and ClickHouse Keeper (CHK) resources are deployed in the same namespace with the same name, their PodDisruptionBudgets (PDBs) will have identical names, causing one PDB to be replaced by the other. This results in only one PDB being created instead of two separate PDBs for each resource type.

Root Cause

The current implementation creates PDB names using only the custom resource name without any prefix:

  ObjectMeta: meta.ObjectMeta{
   Name:            c.nm.Name(interfaces.NameClusterPDB, cluster),
   ...
  },

Solution

Add the chi- and chk- prefix to custom resource PDB names to match the existing pattern used in PDB creation and ensure unique naming across resource types.

Impact Assessment

  • Very Low Risk: This is a non-breaking change that only affects PDB naming
  • No Breaking Changes: Existing deployments will continue to work; only new PDBs will have the prefix
  • Backward Compatibility: Existing PDBs with and without prefixes will continue to function normally
  • Consistency: Aligns PDB naming with the existing naming pattern

Example

Before the fix:

  • CHI resource named "my-cluster" → PDB name: "my-cluster"
  • CHK resource named "my-cluster" → PDB name: "my-cluster" (conflict!)

After the fix:

  • CHI resource named "my-cluster" → PDB name: "chi-my-cluster-"
  • CHK resource named "my-cluster" → PDB name: "chk-my-cluster" (no conflict!)

This ensures both PDBs can coexist in the same namespace without naming conflicts.

Signed-off-by: Piravit Chenpittaya <piravit.chenpittaya@gmail.com>
@Slach
Slach requested a review from sunsingerus October 6, 2025 04:53
@alex-zaitsev
Copy link
Copy Markdown
Member

@karnzx , that has been fixed in 0.25.3. Are you using the latest version? The naming patterns for PDBs is the following now:
[chk|chi]-{name}-{cluster}

@sunsingerus
Copy link
Copy Markdown
Collaborator

fixed in release 0.25.3

@sunsingerus sunsingerus closed this Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0