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

Not creation of -service.yaml when restart is present #851

Closed
gdhgdhgdh opened this issue Oct 13, 2017 · 11 comments
Closed

Not creation of -service.yaml when restart is present #851

gdhgdhgdh opened this issue Oct 13, 2017 · 11 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@gdhgdhgdh
Copy link

Hi, using 1.3.0 of kompose and this trivial docker-compose.yaml:

frontend:
  image: registry:5000/frontend:1.0.0
  ports:
    - "12681:80"
    - "12683:443"
  environment:
    API_URL: "http://10.179.49.0:12603"
  restart: 'no'

redis:
  image: registry:5000/redis:3.0.7
  ports:
    - "12679:6379"
[root@node1 k]# kompose convert
INFO Kubernetes file "redis-service.yaml" created 
INFO Kubernetes file "frontend-pod.yaml" created  
INFO Kubernetes file "redis-deployment.yaml" created 

There's no service for the frontend, which I thought was a bit odd. When I remove the restart line completely, I get a different set of files:

[root@node1 k]# kompose convert
INFO Kubernetes file "frontend-service.yaml" created 
INFO Kubernetes file "redis-service.yaml" created 
INFO Kubernetes file "frontend-deployment.yaml" created 
INFO Kubernetes file "redis-deployment.yaml" created 

Yes, two services and two deployments is what I'd expect. Is this a bug?

@surajnarwade
Copy link
Contributor

@gdhgdhgdh , when you mention restart: no, kompose will generate pod.
for more reference: http://kompose.io/user-guide/#restart

@gdhgdhgdh
Copy link
Author

Yeah that makes sense - the question was really that I would still expect a kind: Service to be created even if it's pointing to a one-off pod. Is that wide of the mark?

@surajnarwade
Copy link
Contributor

@gdhgdhgdh , restart: no will give same behaviour as job, so it makes no sense to create service, I think

@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 14, 2018
@hangyan
Copy link
Contributor

hangyan commented Feb 9, 2018

@surajnarwade @cdrage I thinks the logic should goes to:

  1. with ports, create service by default
  2. without ports, no service. With labels, create Headless Service

This should cause no confuse any more.

related #823

@cdrage
Copy link
Member

cdrage commented Feb 13, 2018

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 13, 2018
@cdrage
Copy link
Member

cdrage commented Feb 13, 2018

@hangyan I agree with all those points. We should implement a label for a headless service rather than relying on "hidden" features such as restart: no. Labels such as specifying to use a Job instead..

@surajnarwade
Copy link
Contributor

+1 @hangyan

@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.

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 Jun 4, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

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 rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 4, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants