Skip to content

Commit 427c528

Browse files
authored
Merge pull request honojs#541 from chaosi-zju/dev
add doc about karmada retain interpreter common problems
2 parents d86d7de + 2ca181a commit 427c528

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/userguide/globalview/customizing-resource-interpreter.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,3 +558,22 @@ A Kyverno `ClusterPolicy` is a collection of rules, which doesn't depend on othe
558558
[15]: https://github.com/karmada-io/karmada/blob/master/pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go#L79-L84
559559
[16]: https://github.com/karmada-io/karmada/blob/master/pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go#L94-L97
560560
[17]: https://github.com/karmada-io/karmada/blob/master/pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go#L99-L105
561+
562+
## Important Notes
563+
564+
### Use the Retain Interpreter to Resolve Control Conflict between the Control Plane and Member Clusters
565+
566+
Issue: Retain is a user-customizable interpreter in Karmada that resolves control conflicts when both the Karmada control plane
567+
and member clusters have control over member cluster resources.
568+
A typical scenario is when the replicas of a member cluster's Deployment is controlled by both the control plane's resource template and the member cluster's HPA.
569+
This leads to an abnormal state of the member cluster's Deployment due to repeated modifications of the replicas by both entities.
570+
571+
Solution:
572+
* Implement the corresponding Retain Interpreter for your workload type resources to decide when to respond to modifications from the control plane's resource template
573+
and when to respond to modifications from the member cluster's HPA.
574+
Currently, Karmada has only implemented the Retain interpreter for Deployment resources. The specific implementation is as follows:
575+
if the resource template has the label resource template.karmada.io/retain-replicas, it will be controlled by the member cluster's HPA;
576+
otherwise, it will be controlled by the control plane's resource template (if the hpaReplicasSyncer controller is explicitly enabled,
577+
Karmada can automatically label the Deployment enabled with HPA with this label). If you need to resolve this conflict for other resources or custom CRD resources,
578+
you can refer to the Retain solution for Deployments.
579+
* If you want a more elegant and comprehensive solution to the above problem, we recommend replacing HPA with [FederatedHPA](../../userguide/autoscaling/federatedhpa.md).

0 commit comments

Comments
 (0)