-
Notifications
You must be signed in to change notification settings - Fork 40
Defining applications in a single file #17
Comments
Any particular reason why you would want to define the whole thing in a single file? Advantages? Would this not lead to "more than "one true way" to do things scenario"? |
I think its OK to force one file / one app way. |
Having multiple files for different microservices makes no sense for smaller applications, that will just increase the user time. |
We can always add support for multiple apps in one file later. |
But the whole point of James S was that we should write define one application/service per file. If we do it otherwise or keep that as a second priority, I am not sure how this serves the purpose. |
I can perhaps agree with that but ...
Being opinionated is very important.
We are enforcing other things, I am sure. So why not this bit? |
Yes, he did, and I respectfully disagree.
We should not be enforcing everything. IMHO, this is a huge step backward in terms of UX, we should let the users decide how they want to structure their application, and what fits best for their scenario, if they want to keep everything in the same file or they want put it in different version control. This increases my developer time by a lot if I have 2 small microservices, and I have to juggle between files. Every spec that I know of provides a way to define multiple objects in one file, OpenShift templates, Docker Compose, OpenCompose. |
OK. But doing multiple apps in multiple files shouldn't be a secondary requirement. |
@pradeepto what does secondary requirement mean here? |
let's decrease the priority and reconsider this later |
or let's not! :) One way can be that we support defining multiple services by separating with a name: web
containers:
- image: quay.io/tomkral/nonroot-nginx
services:
- ports:
- port: 8080
---
name: db
containers:
- image: mongo
services:
- ports:
- port: 3306 Thoughts on this? @pradeepto @kadel @surajssd |
I still don't think that we have a good reason to do that. But if we are doing it than what @containscafeine is suggesting is a good way to do it. |
@containscafeine 👍 |
But having everything in one file is a bad idea, because:
|
I think for this issue we should generate everything, and then specifying one particular app for generation should be covered separately, but I agree, it should be. Also, I agree that this is not going to improve UX a lot, but this could be a use case, so let's go ahead and this. This will not be the preferred way of doing it, but one of the ways! TODO:
|
Before this commit, every application had to be defined in a separate file, and while deploying, had to be passed to the CLI like `kapp covert -f app1.yml -f app2.yml`. In this commit, support for defining multiple applications in one file separated by triple dashes has been added, which means that Kubernetes artifacts for all the applications defined in a given file will be generated. A sample application defined like this will look like - name: database containers: - image: mariadb:10 services: - ports: - port: 3306 --- name: wordpress containers: - image: wordpress:4 services: - ports: - port: 8080 targetPort: 80 This commit also adds an example for this behavior. Fix kedgeproject#17
Looking at the examples, the only way I can see for defining multiple microservices, is by putting them in different files.
e.g. - https://github.com/surajssd/opencomposition/tree/master/examples/allnomagic here, db.yaml and web.yaml have to be separate files.
This is fine and good practice under certain scenarios, but I also want to be able to define this in a single file.
The text was updated successfully, but these errors were encountered: