Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceInterpreterCustomization for Prune #4945

Closed
a7i opened this issue May 15, 2024 · 12 comments
Closed

ResourceInterpreterCustomization for Prune #4945

a7i opened this issue May 15, 2024 · 12 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@a7i
Copy link
Contributor

a7i commented May 15, 2024

What would you like to be added:
Currently, Prune is only supported for built-in, and there are use-cases where we could use Prune for custom resources.

Why is this needed:
this blog does a good job of covering the interpreters and based on the image, we may want to exclude labels/annotations before Work is created
image

@a7i a7i added the kind/feature Categorizes issue or PR as related to a new feature. label May 15, 2024
@XiShanYongYe-Chang
Copy link
Member

@a7i Thanks for your feedback, I think this is an interesting feature point.

Before we start discussing how to do this, let's invite some ideas from people who might be interested in this.

/cc @chaunceyjiang @whitewindmills @RainbowMango @yike21 @iawia002

@XiShanYongYe-Chang
Copy link
Member

we may want to exclude labels/annotations before Work is created

Hi @a7i I'd like to know under what circumstances this would be necessary. Because after communicating with @RainbowMango, I realized that retain can be used to handle the conflict between the Karmada control plane and member clusters.

@a7i
Copy link
Contributor Author

a7i commented May 16, 2024

Prune would be to strip certain fields (e.g. label) from being propagated. With Retain, the label still goes to the member cluster but the value is essentially ignored.

One use-case is that we use a label to determine if a workload should be duplicated in all member clusters or not (the label is matched by the policy labelSelector). There is no need for this label to get propagated to the member clusters.

@XiShanYongYe-Chang
Copy link
Member

Thanks for the use case. I think it makes sense.
cc @RainbowMango

@RainbowMango
Copy link
Member

It seems to make sense, I'll get back to it later.

@whitewindmills
Copy link
Member

One use-case is that we use a label to determine if a workload should be duplicated in all member clusters or not (the label is matched by the policy labelSelector). There is no need for this label to get propagated to the member clusters.

make sense.

@RainbowMango
Copy link
Member

One use-case is that we use a label to determine if a workload should be duplicated in all member clusters or not (the label is matched by the policy labelSelector). There is no need for this label to get propagated to the member clusters.

It seems a reasonable use case that you label resources and let PropagationPolicy match them.
But I have several questions:

  1. I know there is no need for this label to get propagated, but that doesn't do any harm, right?
  2. Can we prune the unnecessary label by OverridePolicy? I'm wondering if this is an option.

@chaunceyjiang
Copy link
Member

🤔 It seems that using OverridePolicy can cove this.

@a7i
Copy link
Contributor Author

a7i commented May 28, 2024

Using Lua gives more flexibility and control than PlaintextOverrider but at the moment, using a ClusterOverridePolicy will work for us. Thank you

/close

@karmada-bot
Copy link
Collaborator

@a7i: Closing this issue.

In response to this:

Using Lua gives more flexibility and control than PlaintextOverrider but at the moment, using a ClusterOverridePolicy will work for us. Thank you

/close

Instructions 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.

@RainbowMango
Copy link
Member

Oh, seems you like Lua.

But, by the way, the LabelAnnotationOverrider and LabelAnnotationOverrider might be more straightforward than PlaintextOverrider.

@a7i
Copy link
Contributor Author

a7i commented May 28, 2024

It's growing on me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: No status
Development

No branches or pull requests

6 participants