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

Can I create work by using native K8s API? #12

Closed
cvvz opened this issue Dec 6, 2021 · 7 comments
Closed

Can I create work by using native K8s API? #12

cvvz opened this issue Dec 6, 2021 · 7 comments
Labels

Comments

@cvvz
Copy link

cvvz commented Dec 6, 2021

I want to create work like deployment by using K8s API but not a WorkManifest with template in it, just like what kubefedV2, karmada or clusternet does. Is it possible?

@qiujian16
Copy link
Member

I do not think kubefedv2, karmada and clusternet has a similar API to deploy workload? Do you ask an API that in higher level primitive which you can define "I want to create deployment in a set of clusters". Or do you want a way that you can directly call deployment API in a spoke cluster?

@cvvz
Copy link
Author

cvvz commented Dec 6, 2021

Use karmada as an example, if I want to create deployment across multiple clusters. I can use the native deployment API of k8s in hub cluster, the components of karmada will do reconciling, and generate ResourceBindingSpec as a result, which is similar to the concept of work in work-api. Is it possible to use OCM the same way? That is, use k8s native API in hub cluster directly rather than use ManifestWork directly.

@qiujian16
Copy link
Member

oh, we do not do it in ocm core component. But it is possible to develop an extension to do that. There is a proposal by @yue9944882 open-cluster-management-io/enhancements#31 that may be able to support this case.

We try to avoid normalizing the interface of the end user in ocm core part, since we see a bunch of different ways users can deliver workload (native way, gitops way, helm way etc.). Instead the ocm core component is trying to provide an interface that other more user oriented interfaces can easily plug in.

@cvvz
Copy link
Author

cvvz commented Dec 7, 2021

Got it! Does it mean that I can create an add-on through addon-framework or a third-party system(i.e., higher primitive) writen by myself (as long as it can transform a native resource to manifestwork) to support my case?

@cvvz cvvz changed the title Can I create work by using original K8s API? Can I create work by using native K8s API? Dec 7, 2021
@qiujian16
Copy link
Member

That is for sure!

@yue9944882
Copy link
Member

weeks ago i had a poc implementation of the enhancement above, now it's holding on the status-reporting feature by the work api from open-cluster-management-io/api#108 b/c the advance workload distribution needs to actively reading the existence/status from the distributed resources. the new api proposed in the enhancement allows users to "import" an existing workload resource from the hub cluster as the template then replicate them to the selected managed clusters and the imported native workload will be automatically packed into a work api.

btw i am also thinking of another approach to convert native api to work -- by a custom kustomize generator plugin, the plugin should be packing all the resources under the kustomize folders to a single work resource.

@github-actions
Copy link

This issue is stale because it has been open for 120 days with no activity. After 14 days of inactivity, it will be closed. Remove the stable label to prevent this issue from being closed.

@github-actions github-actions bot added the Stale label Jul 31, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants