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

Find API call to create object from yaml config #387

Closed
tom-bowles opened this issue Nov 10, 2017 · 13 comments
Closed

Find API call to create object from yaml config #387

tom-bowles opened this issue Nov 10, 2017 · 13 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@tom-bowles
Copy link

I have a yaml file containing configs that I would like to apply as kubectl apply -f my_file.yml would. It is possible to pass configs loaded from yaml unmodified to API calls as discussed in #63 and illustrated in the create_deployment.py example. However, if you have a collection of objects you have to figure out which call to make on which API version to apply each item of config, while the apiVersion and kind keys in the config, which carry this information, get ignored.

Is there any way to find the right API version object and function given the apiVersion and kind values other than to have a mapping in my own code? If not, would it be possible to add such a thing, and maybe generic create and delete calls that read those attributes from the body, thus behaving similarly to kubectl?

@tom-bowles tom-bowles changed the title Find API call to make to create object from yaml config Find API call to create object from yaml config Nov 10, 2017
@nielsole
Copy link

As this is the most requested feature in this repo by far I thought I nudge it to the top of the issues.
(https://github.com/kubernetes-client/python/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc)
Does someone have a plan on how to implement this?
pykube handles this by having a mapping: https://github.com/kelproject/pykube/blob/master/pykube/objects.py
I guess kubectl also has this mapping internally? or does it create a list of possible objects and their endpoints each time by querying the server?

@nakulpathak3
Copy link

Was just searching through the issues for this - there is a related issue #504 and a PR up for this #655. Would be awesome to get it reviewed and in soon.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 26, 2019
@confiq
Copy link

confiq commented May 13, 2019

Hi,
This issue got stale, unfortunately, this client does not support standard kubectl apply/replace -f -.
I only assume it does not have it because it will bring more bugs than ever and it will be really hard to debug...

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 12, 2019
@nielsole
Copy link

Still the scond-most requested feature:
/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jun 13, 2019
@yliaog
Copy link
Contributor

yliaog commented Sep 3, 2019

"kubectl apply -f" is currently implemented on the client side, it has many subtle issues. It would be a significant effort to support that in python. That said, there is server side apply feature in main k/k repo that goes to beta in 1.16. It would be better to wait and use that feature directly in python.

@confiq
Copy link

confiq commented Sep 3, 2019

is there a link for it?

@yliaog
Copy link
Contributor

yliaog commented Sep 3, 2019

kubernetes/kubernetes#73723

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 2, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 1, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/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
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

7 participants