Implement scale subresource on Pod owners#6864
Conversation
In order for PodDisruptionBudgets to work on various groups of Pods
we need to implement the Scale subresource at the direct owner of
the Pod.
Otherwise the PDB will return errors like:
```yaml
status:
conditions:
- lastTransitionTime: "2026-04..."
message: tikvs.core.pingcap.com does not implement the scale subresource
reason: SyncFailed
status: "False"
type: DisruptionAllowed
```
Followup to pingcap#6213
Signed-off-by: SuperQ <superq@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @SuperQ. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6864 +/- ##
=======================================
Coverage 37.44% 37.44%
=======================================
Files 392 392
Lines 22434 22434
=======================================
Hits 8400 8400
Misses 14034 14034
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
It seems not reasonable to add |
|
Sure, the PDB is pretty simple / standard. apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: test-tikv
namespace: test
spec:
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/component: tikv
app.kubernetes.io/instance: testMy understanding is that the PodDisruptionBudget acts on the Pod resource and looks for the Pod's owner. So, this example: apiVersion: v1
kind: Pod
metadata:
name: test-tikv-326vs
namespace: test
labels:
app.kubernetes.io/component: tikv
app.kubernetes.io/instance: test
...
ownerReferences:
- apiVersion: core.pingcap.com/v1alpha1
blockOwnerDeletion: true
controller: true
kind: TiKV
name: test-tikv
uid: ...So when Kubernetes tries to gather all the Pods matching the label spec it looks at the owner references and finds that TiKV is the owner, no mention of TiKVGroup. So the way things are now, the PDB can't work. |
|
https://kubernetes.io/docs/tasks/run-application/configure-pdb/#arbitrary-controllers-and-selectors It seems that Anyway, this PR cannot fix the issue. |
|
Oof, that's an unfortunate restriction. So the only real option is that the TiDB Operator will need to create pods via an indirect method, for example each Pod needs to have an individual StatefulSet. |
|
If you would like, I can file a tracking issue detailing the need here. |
In order for PodDisruptionBudgets to work on various groups of Pods we need to implement the Scale subresource at the direct owner of the Pod.
Otherwise the PDB will return errors like:
Followup to #6213