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

[lfx-mentorship-2023-Sep-Nov] supports promote dependent resources automatically #3842

Closed
XiShanYongYe-Chang opened this issue Jul 27, 2023 · 22 comments
Assignees

Comments

@XiShanYongYe-Chang
Copy link
Member

CNCF LFX mentorship
https://github.com/cncf/mentoring/tree/main/programs/lfx-mentorship/2023/03-Sep-Nov

Mentor: @jwcesign
Backup: @RainbowMango

What would you like to be added:
Provide an automatic promotion mechanism for dependent resources in karmadactl. When promoting a resource, all the resources that it depends on will be automatically promoted as well. For example, promoting the Secret that is dependent by a Deployment.

Why is this needed:

Related issue: #1862

Tasks:

TDB

@zhy76
Copy link
Member

zhy76 commented Jul 27, 2023

I am interested in this and would like to apply for lfx.

@XiShanYongYe-Chang
Copy link
Member Author

Now we are still in the project proposal stage. According to the timeline, mentees can start applying at the time Wed Aug 16 - Tues Aug 29, 5:00 PM PDT.

@AdiAkhileshSingh15
Copy link

Hey,
I'm interested in this project and I plan to apply as a Mentee once LFX Fall applications are open.
Also, I'm curious to know if there are any beginner-friendly issues available for me to start contributing and get to know more about the project.

Any help would be highly appreciated.
Thanks!

@YashPimple
Copy link

YashPimple commented Aug 3, 2023

Hello @jwcesign @RainbowMango I am interested in learning about this project and want to work on this project under LFX Mentorship Karmada supports promote dependent resources automatically
also, this issue seems like a great starting point for getting started with a contribution to the Karmada. Landed here from the CNCF mentorship repository

I liked how everything is very well documented. I look forward to applying to this project for this term.

@tamil07
Copy link

tamil07 commented Aug 12, 2023

Hi, I am interested to contribute to this project but not as a Mentee but just as a part time as I don't wish to get paid.
Would it be possible to so?

@XiShanYongYe-Chang
Copy link
Member Author

Hi, I am interested to contribute to this project but not as a Mentee but just as a part time as I don't wish to get paid.
Would it be possible to so?

Hi @tamil07, thank you very much for participating in the open-source activities of the Karmada community. I believe that you can contribute to the entire project, such as solution design, code review, test design and execution, documentation writing and promotion, and so on.

@AvineshTripathi
Copy link

Hey @XiShanYongYe-Chang wrt to this issue I looked after the normal promote feature PR with -d=true flag and based on discussion I can see the main task is to give support for CRD and for not only promote command with dep but also advance scheduling that cannot be done as finding dependency is a problem(https://karmada.io/docs/v1.3/userguide/globalview/customizing-resource-interpreter/#interpretdependency)

I tried looking for ways to get dependecies for CRDS but still have no success finding one! wanted to ask if there are any discussions wrt to it where any rough solutions was discussed so that I can deep dive those and work in similar direction for possible solutions

@XiShanYongYe-Chang
Copy link
Member Author

cc the owner @jwcesign to help take an answer.

@jwcesign
Copy link
Member

jwcesign commented Aug 14, 2023

To automatically promote the dependency resource, we need to identify the specific resources on which it depends. There are two methods for parsing these dependencies: through a webhook or using Lua. Here are the steps involved in each approach:

  1. Using a webhook:

    • karmadactl sends a request to the webhook and parses the dependencies.
    • Based on this information, it creates the corresponding resource template and PropagationPolicy in the karmada control plane.
    • Note that requesting the webhook may pose difficulties, such as requiring port-forwarding.
  2. Using Lua configuration:

    • karmadactl retrieves the Lua configuration and parses the dependencies.
      configurableInterpreter := declarative.NewConfigurableInterpreter(nil)
    • It then generates the relevant resource template and pp in the Karmada control plane.

/cc @AvineshTripathi

@AvineshTripathi
Copy link

Thanks @jwcesign for the description I'll look into the lua interpretor today. Does that also find dependency or does it only generates the template?

@jwcesign
Copy link
Member

jwcesign commented Aug 14, 2023

Does that also find dependency or does it only generates the template?

Hi, @AdiAkhileshSingh15 , It only finds the dependencies. The related code:

func (h *healthInterpretationRule) Run(interpreter *declarative.ConfigurableInterpreter, args RuleArgs) *RuleResult {

@AvineshTripathi
Copy link

Oh thanks let me try that as well! would check out today

@AvineshTripathi
Copy link

Hey mentors I have submitted my application for this issue and with my cover later I have added a bit about my understanding of the issue and problems we are facing and finally a little bit about solutions. Please have a look into it and do let me know if you have some more question or you need me to add more details. Thank you!

@zhy76
Copy link
Member

zhy76 commented Aug 22, 2023

I have a question after studying this problem. Karmada already supports two methods of interpreting crd:

  1. webhook interpreter.
  2. configuration interpreter.

Both methods can query the dependencies of resources. It seems that we only need to get the obj of the resources that need to be promoted in the member cluster during the promotion process, call ResourceInterpreter.GetDependencies(obj) to get the dependency information of the resources, create resource template and corresponding PP for each dependency.
Is my understanding correct? What points need to be paid attention to in this process? Thanks~

@jwcesign
Copy link
Member

jwcesign commented Aug 22, 2023

Hi @zhy76, the main issue is how to implement it with karmadactl. From the perspective of karmada components, this is not difficult:

  1. webhook interpreter - call the webhook service from the Karmada components.
  2. configuration interpreter - call it with Luva engine. (The functionality could be integrated into karmadactl.)

But with karmadactl, How can we call the service in the clusters?

@zhy76
Copy link
Member

zhy76 commented Sep 6, 2023

Task to be done:

  • support promote native dependent resources automatically.
  • support promote thirdparty dependent resources automatically.
  • support promote CRD dependent resources automatically.
    • implement webhook interpreter adapter to get dependencies.
    • use configuration interpreter to get dependencies.
  • E2E tests.
  • Doc update.

@zhy76
Copy link
Member

zhy76 commented Sep 6, 2023

/assign

@jwcesign
Copy link
Member

jwcesign commented Sep 6, 2023

Hi, we need a proposal first. Can we add it to tasks?

@XiShanYongYe-Chang
Copy link
Member Author

Hi @jwcesign @zhy76 The current issue is used for the release of LFX tasks. A new issue can be submitted to manage tasks.

@zhy76
Copy link
Member

zhy76 commented Sep 6, 2023

Hi @jwcesign @zhy76 The current issue is used for the release of LFX tasks. A new issue can be submitted to manage tasks.

OK, I will submit a new issue.

@XiShanYongYe-Chang
Copy link
Member Author

XiShanYongYe-Chang commented Sep 6, 2023

Thank you to everyone interested in Karmada. Next year, the lfx Karmada community will also apply for more projects. Please continue to stay tuned.

It will be tracked by #4036.
/close

@karmada-bot
Copy link
Collaborator

@XiShanYongYe-Chang: Closing this issue.

In response to this:

Thank you to everyone interested in Karmada. Next year, the lfx Karmada community will also apply for more projects. Please continue to stay tuned.

It will be tracked by #4036.
/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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants