Comments (2)
This makes sense to me, and this write up makes the issue more clear to me than our convo yesterday. Things such as "service," for example are unique to k8s. Keeping a generic interface that was suitable for multiple schedulers before, meant not hooking into app creation, for instance, to define a service. It had to be done elsewhere where it was a tad trickier. I get it.
It no longer needs to be this way. To be fair, there was probably a clever way to have done this better in the past too, but hindsight is 20/20. I'm no django expert, but here's what I have in mind...
Separate generic, highly reusable k8s functions such as crud operations on services, rcs, etc. into their own module for eventual extraction into a package. (I know you already intend that.) Then create a layer between that and the model with very generic fuction names on its interface-- things like postAppCreate()
or postDomainAdd()
. The idea would be that in any given implementation of this layer, the hooks can be implemented against the underlying scheduler (k8s in this case) without function names like start()
or scale()
polluting the interface. This layer's functions can be observers of all the events on the model. Theoretical support for another scheduler in the future is thus only a matter of providing an alternate implementation of a listener/observer layer that's already hooked into the model.
This would allow, for instance, k8s service creation to be triggered by app creation, even though services aren't a thing in other schedulers. Persisting a new app object triggers postAppCreate()
, which in this case creates a service, but in the theoretical case of another scheduler might do something else entirely or may even be a no-op.
from controller.
I'm going to close this as we have done a lot to separate things out and the high level functions left in the scheduler are pretty slim, beside run
, which is up for a rewrite with Jobs
from controller.
Related Issues (20)
- Custom domains should be supported by experimental ingress HOT 1
- scheduler.resources.api() needs refactoring HOT 1
- Exception thrown during POST /v2/apps/ HOT 2
- 'NoneType' object is not subscriptable HOT 1
- Improvement: display current number of processes in `deis ps` HOT 1
- Missing global settings customization in helm chart HOT 1
- Create users with read only permission? HOT 1
- router.deis./ssl.enforce annotation not persisted on service creation HOT 1
- LDAP authentication requires a valid group filter and group basedn HOT 1
- LDAP authentication with incorrect password causes a 500 HOT 1
- deis autoscale with Error: Unknown Error (400) HOT 6
- When namespace is missing, apps:destroy should delete from postgres db HOT 1
- Critical flaw in scale method allows for entire namespace deletion HOT 5
- Only able to create 200 releases? HOT 1
- Wrong service selector after switch from Dockerfile to Docker Image HOT 1
- DEIS_DEPLOY_HOOK_URLS too early? HOT 1
- DEIS_DEPLOY_PROCFILE_MISSING_REMOVE broken HOT 4
- deis run need pods-create permissions (rbac) HOT 2
- apps to namespace mapping HOT 2
- deis apps:list is empty. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controller.