-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Proposal: First-generation of kubectl set *
commands
#21648
Comments
This sounds pretty good to me, though we might want to break some of the volume functionality into multiple commands. I'd like Can we chain Nit: I might prefer Even if edit supports reading from stdin, we may want a --edit flag for these and other mutators/generators. |
cc @kubernetes/kubectl |
@ncdc I didn't see this on your 1.3 list. Should it be on the list? |
Yes we can chain |
@bgrant0607 it wasn't originally, but I will discuss it with my team and see if we can fit it in. |
We need at least |
So here's a concrete proposal before I start moving code upstream. Implement the two most valuable primitives - For each one, do an issue that describes the basic syntax - agree on that, then move the impl upstream. |
sgtm |
Is anyone planning to work / already working on this? |
I've got probe and env in a branch. Volumes is more involved, because Some points raised by folks:
Will post some examples. |
I'll start working on |
I'll do probe - probably the least controversial, and the most recent On May 10, 2016, at 7:52 PM, Janet Kuo notifications@github.com wrote: I'll start working on kubectl set image. — |
PR for probe is #25451 |
Automatic merge from submit-queue Add 'kubectl set' ## Pull Request Guidelines 1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md). 1. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md). 1. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below. ```release-note ``` Ref #21648, the parent `kubectl set` command; will add more sub-command in subsequent PRs. @kubernetes/kubectl [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
Any chance of having |
Automatic merge from submit-queue (batch tested with PRs 51377, 46580, 50998, 51466, 49749) feat(#21648 )Add kubectl set env command. **What this PR does / why we need it**: #21648 Moved from OpenShift to Kubenetes. @Kargakis @smarterclayton **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
configmap set command: #24049 |
@smarterclayton i am working with set probe and lifecycle. it is helpful for user. |
@zjj2wry done |
@smarterclayton i am working with set volume |
PR for I was assigned but don't have much background. Maybe someone on this thread would be interested in reviewing? |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
For 1.3 we'll be considering adding a number of commands developed upstream in OpenShift into kubectl - specifically, commands that assist the user in performing very common mutations to our core objects.
Current implementations are:
As proposed in https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/deploy.md#kubectl-set, these commands would live under
kubectl set
and operate generically on classes of objects (for the commands above, they would operate on objects with mutable pod templates, for other commands, more generic structure should be possible).The commands would take as input a JSON/YAML file, a real object on the server, or a synthetic resource generated by looking at multiple server resources, transform the object, and create a patch on the original object that results in the desired mutation. The patch would be applied to the object and then the object mutated on the server.
It should be possible to specify
-o yaml
and generate a file that can be chained to later commands, for instance:We need to ensure the usability of chaining (both apply, patch, replace, and create are all viable terminations) as part of this work.
In practice, we have found it valuable to have the default mode for the set commands to "list" the current state in a pattern that enables users to guess at what they need to do to change the field. Mutation via CLI flags is hard - each flag must be carefully chosen to balance ease of comprehension with ability to express most of the API. It is acceptable to punt some use cases in mutation to the
edit
command. Most commands should focus on having a "clear" or "remove" flag that can remove a targeted entry, a simple set of flags that set the default values, and where possible try to support the minimum amount of simultaneous change.Set commands should have a consistent code pattern to make implementing new setters easy. As much as possible, it should be able to take an existing set command, define a business transformation (adding X to Y) and map that to existing code that is tested in a standard way, following https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md#command-implementation-conventions.
OpenShift implementations of the various commands need varying levels of cleanup:
oc set env
is the oldest of the downstream implementations and does not support downward API flags at the current time. However, it is tuned very well to make adding and removing structured variables easy. https://github.com/openshift/origin/blob/master/pkg/cmd/cli/cmd/set/env.gooc set volumes
is the most complex of the commands today - given the number of volumes we have a choice was made to focus on the most common (claims, empty dir, secrets) and force users to patch other commands. Helpers were added to make creating a claim and adding it to a template very easy. https://github.com/openshift/origin/blob/master/pkg/cmd/cli/cmd/set/volume.gooc set probe
is brand new and formalizes some of the more recent kubectl behaviors into a set of core library methods (specifically, iteratively patching a set of objects) as well as handling the transformation pattern cleanly. Add 'oc set probe' for setting readiness and liveness openshift/origin#7331oc set triggers
represents a command that exposes a generic interface across two similar, but not identical concepts (build and deployment triggers, which result in a mutation of the object based on external stimulus). It is the most complex because the underlying API is dissimilar, but tries to present a common and simple pattern to users. It explicitly does not handle setting multiple triggers of certain types at a time as an 80% use case solution. Setting deployment and build triggers via CLI openshift/origin#7423The text was updated successfully, but these errors were encountered: