Skip to content

fix: add podUpdatePolicy to all ComponentDefinition templates#2515

Closed
Alegrowin wants to merge 1 commit into
apecloud:mainfrom
Alegrowin:fix/add-pod-update-policy-to-cmpd-templates
Closed

fix: add podUpdatePolicy to all ComponentDefinition templates#2515
Alegrowin wants to merge 1 commit into
apecloud:mainfrom
Alegrowin:fix/add-pod-update-policy-to-cmpd-templates

Conversation

@Alegrowin

Copy link
Copy Markdown

Summary

When podUpdatePolicy is not explicitly set in cmpd templates, the KubeBlocks operator defaults it to PreferInPlace after creation. This changes the apps.kubeblocks.io/immutable-hash annotation, causing the addon controller to mark ComponentDefinitions as Unavailable with "immutable fields can't be updated" on next reconciliation.

Changes

Adds podUpdatePolicy: PreferInPlace to all 122 ComponentDefinition template files across all addons, ensuring the hash is stable from creation.

Affected addons: apecloud-mysql, clickhouse, elasticsearch, etcd, falkordb, greptimedb, influxdb, kafka, llm, loki, mariadb, milvus, minio, mogdb, mongodb, mysql, nebula, neo4j, neon, opensearch, orchestrator, orioledb, polardbx, postgresql, pulsar, qdrant, rabbitmq, redis, risingwave, rocketmq, starrocks-ce, tidb, vanilla-postgresql, victoria-metrics, weaviate, xinference, yashandb, zookeeper

Verification

  1. Install any addon (e.g. helm upgrade -i kb-addon-rabbitmq kubeblocks-addons/rabbitmq -n kubeblocks-system)
  2. Check ComponentDefinition has podUpdatePolicy: PreferInPlace set: kubectl get cmpd <name> -o yaml | grep podUpdatePolicy
  3. Verify hash remains stable across reconciliation cycles: kubectl get cmpd <name> -o jsonpath='{.metadata.annotations.apps\.kubeblocks\.io/immutable-hash}'

Companion PR

@apecloud-bot apecloud-bot added the chart-release Auto release chart when PR merged main. label Mar 20, 2026
@leon-ape

leon-ape commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

It’s not necessary to explicitly set podUpdatePolicy in addon manifests after apecloud/kubeblocks#10095, because the actual compatibility issue is resolved by excluding these fields from cmpdHash().

@weicao

weicao commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review by Magnus(mariadb head+open-PR 审查范围内触及本 PR)— 建议关闭(echo @leon-ape 的结论,补两个新点)

本 PR 设置的 podUpdatePolicy: PreferInPlace 是 API 默认值(kubebuilder default),且其要解决的兼容性问题已由 apecloud/kubeblocks#10095(2026-03-20 合并,将该字段排除出 cmpdHash)根治——leon-ape 当时已指出,此后 PR 无响应,已 ~4 个月未更新。

补充两个此前未被提出的点(即使方向被重新采纳也需要解决):

  1. 122 个 CMPD 模板变更零 Chart.yaml bump:CMPD 名随 chart 版本模板化,spec 变更不 bump 版本在未含 #10095 的 KB 版本上恰会触发它声称要修的 immutable 更新失败;与仓库「CMPD spec 变更必须版本 bump」惯例不符。
  2. 已过时于当前结构:以 mariadb 为例,main 现有 cmpd.yaml / cmpd-replication.yaml / cmpd-galera.yaml 三个 CMPD,本 PR(2026-03 的快照)只改了第一个——按它自己的理论也漏了三分之二。

CI:pr-label-check 失败。mergeable 但 stale。建议:关闭,理由=已被 #10095 根治。

@leon-ape leon-ape closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chart-release Auto release chart when PR merged main.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants