-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Introduce Resource creation and duplication functionality #954
base: master
Are you sure you want to change the base?
Conversation
…urces by using the current resource as a starting point
@NickyMateev This is by far the best PR I've gotten to date. Well done Sir! |
This seems like a great improvement to me. I agree that long-lived objects should live in source control, but I often find that I need to create short-term objects for adhoc testing purposes. I often have to follow this process to copy such objects:
This PR would greatly simplify this common workflow. |
Hey, I just stumbled upn this by accident, and it would be the last thing that I need in my workflow to leave kubectl behind. Are there any blockers, or is there some way that one could help to move this along to get the functionality integrated? |
Hi, I really hope this PR will not be forgotten and will go trough |
@NickyMateev could you merge latest master and resolve conflicts? |
@NickyMateev @derailed can we push this PR through? |
Would love to see this feature in - is there anything else to do than just resolving conflicts? |
definite +1 as well. creating of new resources is even more important than duplication imo. both are great to have, but creation i think would be most used. |
This commit refactors the code from PR derailed#954 to make it work with current master, as well as only enable the "Create" and "Duplicate" actions when K9s is not in read-only mode. Also, both actions will use `kubectl create` instead of `kubectl apply` to create the resource, as this will automatically prevent the user from overwriting an existing resource by name.
Since this PR is already 3 years old and probably long forgotten by the original author, I've reworked this in a new one #2563. Maybe that one fits the bill and will see the light of day :) |
This commit refactors the code from PR derailed#954 to make it work with current master, as well as only enable the "Create" and "Duplicate" actions when K9s is not in read-only mode. Also, both actions will use `kubectl create` instead of `kubectl apply` to create the resource, as this will automatically prevent the user from overwriting an existing resource by name.
This commit refactors the code from PR derailed#954 to make it work with current master, as well as only enable the "Create" and "Duplicate" actions when K9s is not in read-only mode. Also, both actions will use `kubectl create` instead of `kubectl apply` to create the resource, as this will automatically prevent the user from overwriting an existing resource by name.
This commit refactors the code from PR derailed#954 to make it work with current master, as well as only enable the "Create" and "Duplicate" actions when K9s is not in read-only mode. Also, both actions will use `kubectl create` instead of `kubectl apply` to create the resource, as this will automatically prevent the user from overwriting an existing resource by name.
Introduce Resource creation and duplication functionality
I love k9s but one thing which always bugged me was having to create new resources - it usually meant that I had to:
kubectl apply -f temp.yaml
temp.yaml
as it's no longer needed (or actually forget to delete it, which happens often which leads to junk/unused files on my file system)This is way too much of a hassle and at best it slows down an operator's workflow and at worst it may break his focus while working intensely on some issue as the operator now has to do all this miscellaneous stuff when all he wanted to do was to apply a new Kubernetes resource.
Proposal
This PR propose the addition of two new keybindings:
---
) and upon closing the text editor the content will be applied to your Kubernetes cluster.The above two actions are things I often need to do and I'm sure other operators also have faced similar issues of having to switch contexts between k9s and another terminal window just to do them.
Related issues
There seem to be an previous (closed) issues which inquire about functionality about easily creating new resources:
#191 and #496
Closing thoughts
To me k9s is an awesome tool which saves a ton of time when operating Kubernetes clusters. The only missing peace for me was creation of new resources with ease and quickness. I believe this PR proposed a solution to this missing peace which would make k9s a complete package for anyone who wishes to operate Kubernetes clusters with maximum efficiency.