-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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: scaling interface #1629
Comments
We already have 3 API verbs URL-encoded - watch, proxy, and redirect. I think I'm ok with a few more. Regarding relative vs absolute - In practice we started with relative and realized we wanted absolute for idempotence. I would argue relative should be optional and absolute should be the default (like specifying a name is required and generating it is optional). Is resize limited to a single dimension for all verbs? Is it parameterizable in the future? Or should all objects have a dimensionality of one for resize? |
Verbs: These verbs appear early in URL paths, preceding the resource collections (kinds), namespaces, and names? Relative vs. absolute: I agree. Dimensionality: I was only thinking about a single dimension: horizontal scaling. What I imagine is that an autoscaler would watch a set of pods and invoke a resize operation. It wouldn't need to understand what was controlling the pods or what was implementing resize. It might be a single replication controller, a replication controller controller, replication and nominal service controller, a multi-release deployment controller, a job controller, etc. However, it would need to have an expectation that tweaking resize would change the number of monitored pods accordingly. I consider vertical resource resizing (cpu, memory, etc.) of pods to be a separate issue (#2072), one which is more complex not only due to multiple dimensions, but also due to pod resources vs. container resources, request vs. limit, in place update vs. rescheduling, and other issues. |
I am ok with this approach if the resize verb is something implemented by a runtime.Object, and not that a RESTStorage resize operation is authored. I want to make sure we have a single choke point for intercepting all Update operations as part of my ability to weave in admission control. I have some other concerns on a resize verb and policy sychronization. |
On policy, it sounds like I need to separately manage /resize/ns/{namespace}/object/name from /ns/{namespace}/object/name. That kind of complicates the system in my opinion so we should be careful before taking on new verbs without thinking it through. |
I was thinking of something like POST .../ns/{namespace}/{kind}/{name}/op/resize That would make it easier to delegate the handling of special verbs to each registry object, and for the set of verbs to be discoverable. This is sort of the approach used by GCE, though I don't think it puts verbs into a sub-collection. |
Structurally, it would be better to watch via GET /ns/kind/obj/name/op/watch because then watch can be properly sharded
|
+1 to this proposal in general. Caveats: This is likely to make client codegen harder (not that we're doing it I think we should intercept these even higher in the stack, likely the I don't think we should support incremental resize, as it seems inherently Brendan
|
This proposal is really about an abstract interface for resizable entities. So, to put forth a more RESTful alternative -- feel free to shoot it down: We could create a new virtual REST object:
Any object that wanted to be scalable, such as ReplicationController, would automatically create a Scaler object. Modifications to the Scaler object would in turn modify the corresponding ReplicationController. This would achieve the goal of making the auto-scaler not need to understand the full details of all types of controllers that wanted to be scalable. Note that etcd is adding multi-object transactions, which should make such multi-object "macros" easier to manage. |
Or similarly, expose
which supports GET / PUT. I don't think
So the mechanical transformation you want is
Unlike spec/status sub objects, there's no real need to mutate the metadata at the same time as the scaler. So having a totally decoupled resource representation in the API makes sense. ----- Original Message -----
|
I agree with @smarterclayton that |
Could someone explain the resize verb concept a little more? What object is the target? From some of the examples above it seemed the target was a pod (for example), but I don't understand what it means to horizontally resize a pod (wouldn't you just create a copy of it, or delete it)? Or maybe the target is some kind of meata-object? |
Sorry for being dense, I just figured out that the replication controller is the object with a resize verb. That makes sense. |
#5054 contains some fixes required to allow sub resources like /resize to work, as well as an example with /binding. I made "Binding" generic to type, (it's a name, target, and an object reference to be bound to). |
Note that the current proposal is |
After further thought, I'm thinking we should call this |
In progress: #12217 |
when atuoscaling can be done? do you need our team help to do this? |
Several issues here:
I think we should close this particular issue as it seems it's redundant. |
…-fix OCPBUGS-15726: UPSTREAM: 118881: fix openapi/v3 non local apiservices aggregation
Auto-scaling has been discussed in many issues/PRs: #1007, #1178, #170, ...
This is about how an auto-scaler should be layered on the API.
In the case of auto-scaling, the currently desired number of replicas won't be statically configured by the user, and should not be among the fields diff'ed by the configuration system. #1201 addresses that problem.
It should be possible to auto-scale applications with multiple release tracks, and it should be possible to auto-scale and perform a rolling update (#1353) simultaneously. If the auto-scaler were tied to a specific replication controller, then it would at least need a label selector (or possibly reference to a service object, but I prefer direct use of label selectors) to identify the whole serving set in order to assess current capacity.
Additionally, if the approach of creating a new replication controller were used to deploy new images, the auto-scaler would need to be updated to resize the new replication controller.
And, if we introduced higher-level API objects to manage multiple underlying objects or other new controller types (e.g., JobController - #1624), the auto-scaler would need to support all those API types.
Instead of declaratively manipulating all these object types directly, the auto-scaler should target a narrower API: an imperative resize "verb" (i.e., POST to a URL). Any API object capable of being auto-scaled (e.g., replicationController) could support that verb. The verb would update the desired replica count for that object. With this approach, resizing could also be supported generically by the CLI (lots of discussion in #1325), would simplify client code more generally, and could simplify authorization logic.
Yes, verbs of all flavors are discouraged by REST purists, but this approach avoids per-object-type verb proliferation and facilitates metaprogramming, addressing their main concrete concerns. The alternative would be a generic declarative subobject containing (essentially) just the size. That seems like a lot of metadata and object-lifecycle overhead for little gain.
Details to be worked out:
-
,_
, and.
).The text was updated successfully, but these errors were encountered: