karmada
karmada copied to clipboard
add workload annotation propagationpolicy.karmada.io/cluster
What would you like to be added:
add Annotation:key=propagationpolicy.karmada.io/cluster
, value is cluster name
Annotation must be added before call Interperter Retain
InterpreterOperation
Why is this needed: interperter webhook server need to know cluster that workload belong to
+1
How about cluster.karmada.io/name: ClusterA
?
+1
How about
cluster.karmada.io/name: ClusterA
?
I have no objection about this
+1 This annotation allows users to better handle resource templates when extending the resource interpreter.
I can try to fix this issue.
/assign
Can you mention it at tomorrow's community meeting?
Can you mention it at tomorrow's community meeting?
sure
The annotation seems to indicate a destination decision that is supposed made by the scheduler. That is concerning.
interperter webhook server need to know cluster that workload belong to
Can you explain in more detail? Why the webhook need to know cluster info?
Why the webhook need to know cluster info?
The problem we encountered: We only need to retain the modifications of the member clusters in specific clusters, but this interface cannot distinguish which member cluster the current resource is to be distributed to.
Therefore, our current approach is to use an OP to annotation resources with the name of the cluster.
https://github.com/karmada-io/karmada/blob/adef1e59748e1e1d31cb75fffe406b5dd69a66d7/pkg/resourceinterpreter/interpreter.go#L51-L54
Cluster information can provide more judgment basis for user-defined extension. Can we continue to promote this issue? @RainbowMango
Cluster information can provide more judgment basis for user-defined extension. Can we continue to promote this issue? @RainbowMango
Providing the following annotation can provide users with stronger extensions
cluster.karmada.io/name: ClusterA
Alternatively, providing the target cluster name in the ctx context can also achieve the same results
func (e *atmscmInterpreter) Handle(ctx context.Context, req interpreter.Request) interpreter.Response {
targetCluster:= ctx.Value("targetCluster").(string)
...
}
Or provide target cluster name in interpreter.Request
func (e *atmscmInterpreter) Handle(ctx context.Context, req interpreter.Request) interpreter.Response {
targetCluster:= req.TargetCluster
...
}