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

Standardize extension patterns #31571

Closed
bgrant0607 opened this issue Aug 27, 2016 · 16 comments
Closed

Standardize extension patterns #31571

bgrant0607 opened this issue Aug 27, 2016 · 16 comments
Labels
area/extensibility lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.

Comments

@bgrant0607
Copy link
Member

bgrant0607 commented Aug 27, 2016

This occurred to me when discussing with @davidopp and has come up in multiple contexts recently. Maybe this could be split into at least 2 issues, but I'll start with 1.

  1. We are developing a pattern by which we allow people to plug in their own controllers for our objects, by specifying some kind of "type" that indicates which controller has responsibility, and sometimes what policy to apply, as well. Examples:
    • Multi-scheduler support, currently via annotation on Pod.
    • Ingress, currently via annotation on Ingress.
    • Deployment, discussed implementation using unsupported rollout strategies
    • HorizontalPodAutoscaling, discussed using annotations
    • StorageClass, supports multiple classes, not sure about multiple provisioners
    • Maybe NetworkPolicy applies
    • FlexVolume
    • LoadBalancer (cloud-provider-specific)
  2. Sometimes we need to plumb custom parameters down to these controllers. A list of key-value pairs is not awesome. This problem is more acute for ThirdPartyResource, and we're going to have it with the Service Catalog. I suggest we adopt a schema description mechanism, such as JSONSchema. We don't need the whole REST operation side of Swagger/OpenAPI.

cc @thockin @smarterclayton @lavalamp @davidopp

@bgrant0607 bgrant0607 added priority/backlog Higher priority than priority/awaiting-more-evidence. area/extensibility team/api labels Aug 27, 2016
@pmorie
Copy link
Member

pmorie commented Aug 29, 2016

FTR, storage class supports multiple provisioners

@pmorie
Copy link
Member

pmorie commented Aug 29, 2016

Another issue in this space: TPR is namespaced, while not all extension controllers are (example: storage class is global)

@smarterclayton
Copy link
Contributor

I think this is critically important. Allowing custom extension of core API concepts makes those API concepts more important because clients can revolve around them even if they don't know what they do.

I.e. an HPA object that points to a custom metric that the client doesn't understand can still provide value for a UI or CLI, because it can show that metric to a human who can understand it. The UI or CLI can delete that HPA (stops scaling) or "pause" the autoscaler, or set limits, or allow generic metrics setting.

Having the standard API object that people can coordinate around is to me the best outcome for Kubernetes - giving people room to provide alternate reactions to standard API objects.

@m1093782566
Copy link
Contributor

I think Annotation is useful for users defining their own need flexibly, like strategy, attribute and so on. It can reduce the work load to maintain them as API Resource type in types.go. However, the current map[string]string Annotation key-value pair also has its limitations, it's unable to describe more complicated scenarios.

@davidopp
Copy link
Member

@smarterclayton It sounds like what you're talking about might be closer to the "opaque integer resource" idea (#28312) whereas I think @bgrant0607 was talking more about some kind of delegation or partitioning mechanism to direct requests to the proper instance of something that has multiple instances (most likely one "out-of-the-box" instance and one or more custom instances). Or do you see these are more similar than I do?

@bgrant0607
Copy link
Member Author

In the long run, I think all APIs that need this capability should use fields. Annotations aren't discoverable.

Perhaps we should even ask the question what resources won't ever need this?

@smarterclayton
Copy link
Contributor

I mentioned HPA because while discussing it it was clear the pattern for custom metrics resembles - core API object, many controllers, preferred controller. An object that can be used by many clients to coordinate may not understand all the clients, and while we might have a first party field (CPU) a totally generic field (GenericMetricReference) which is opaque to clients can actually be the signal to the controller to act on it.

Ie the presence of generic metric "biz.metric.1023" is a signal to an autoscaler extension controller in the same way that scheduler annotation may put you into a queue on an extension scheduler. That controller would be outside the system - HPA controller would observe the totally generic metric (as distinct from heapster opaque generic metric) and do nothing.

@bgrant0607
Copy link
Member Author

cc @erictune

@bgrant0607
Copy link
Member Author

Other recent examples where this would be useful:

  • Service broker, being discussed as part of the service catalog SIG
  • Service account token generation, for generating other types of tokens
  • DaemonSet updates ([WiP] DaemonSet updates #31693), similar to the Deployment use case

@0xmichalis
Copy link
Contributor

cc @mfojtik

@bgrant0607 bgrant0607 added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels Nov 3, 2016
@bgrant0607
Copy link
Member Author

Making a high-level proposal in the core/layers doc extensions section:
https://docs.google.com/document/d/1XkjVm4bOeiVkj-Xt1LgoGiqWsBfNozJ51dyI-ljzt1o/edit#

@bgrant0607 bgrant0607 added sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. and removed sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. labels Oct 26, 2017
@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.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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 Jan 24, 2018
@bgrant0607
Copy link
Member Author

/remove-lifecycle stale
/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 26, 2018
@vllry
Copy link
Contributor

vllry commented Jun 11, 2019

/priority backlog

@k8s-ci-robot k8s-ci-robot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Jun 11, 2019
@vllry
Copy link
Contributor

vllry commented Jun 11, 2019

/remove-priority important-soon

@k8s-ci-robot k8s-ci-robot removed the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jun 11, 2019
@thockin
Copy link
Member

thockin commented Aug 19, 2022

We have a pretty well established pattern based on CRDs now. Closing old issues is fun :)

@thockin thockin closed this as completed Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/extensibility lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.
Projects
None yet
Development

No branches or pull requests

10 participants