-
Notifications
You must be signed in to change notification settings - Fork 12
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
Labels support #23
Comments
So,
Both of these serve a different purpose. References: |
Agreed, lets start with labels. What do you mean by 'top level directive'? |
@kadel yep, sorry about that, not a 'top level directive', but something like - version: "0.1-dev"
services:
name: foobar
containers:
- image: foo/bar:tag
env:
- foo=bar
labels:
"status": "shipit"
command: ["/bin/foobar"]
args:
- "-f"
- "/tmp/foobar"
ports:
- port: 8080:80 |
With top level what I understood is a label that is declared once and then that is applied to everything opencompose tool generates, as a way to identify this was auto-generated with opencompose. |
I am assuming that this issue is only addressing labels and am proposing something for that. I noticed one thing in opencompose that we want user to do things in only one way, but how feasible is that? What I mean here is that we ask user to mention labels in each and every service but what happens when a user wants to do it for the entire project? shouldnt we have root level labels? We could have a root level label which is applied to each and everything we create in the project like deployments, pvc, etc. This is similar to the what auto-generated artifacts in openshift look like. So what I think here is that we should have few things that are root level and service level both. And it should be done in such a way that we don't need to implement it twice basically reuse the stuff. |
OK, Lets focus on label right now. |
Moreover, after discussions with @kadel and @surajssd, I don't think it makes sense to have container level labels, which is version: 0.1-dev
services:
- name: helloworld
containers:
- image: tomaskral/nonroot-nginx
ports:
- port: 8080
labels:
status: shipit
zone: public This does not make sense because all the containers for that service will be in the same pod and it will not make sense to apply labels on a pod level, the labels should trickle down from deployment and service level. So, what I am proposing for service level labels is something like this - version: 0.1-dev
services:
- name: helloworld
containers:
- image: tomaskral/nonroot-nginx
ports:
- port: 8080
labels:
status: shipit
zone: public I have a WIP draft PR for this at #82, @kadel @tnozicka @surajssd PTAL for the approach and design. TIA |
Proposed syntax looks good to me. |
syntax lgtm |
@containscafeine, sorry if this is not the place to ask this question but I was taking a look at the issues and you mentioned that "Labels are for identifying metadata and for identifying attributes of objects that are meaningful and relevant to users, but which do not directly imply semantics to the core system." Where can I go to if I want the semantic labels? Especifically Kubernetes ExternalIPs? Context: I came to test out opencompose since I needed a way to assign an already existing domain/AWS Elastic IP to a service, which I tried to achieve with kompose.io before @kadel kindly redirected me here instead. In other words, I have an existing AWS Elastic IP I do not want to change and I want OpenCompose to instantiate my services pointing to that EIP via a mechanism similar to kompose's service labels. |
Hi @brainstorm, In Kompose we had to use labels to add new stuff to file. I've created new issue regarding ExternalIPs - #101 |
OpenCompose file should allow user to specify annotations and labels on his objects.
The text was updated successfully, but these errors were encountered: