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

kompose passes a kubernetes deployment without image #571

Closed
surajssd opened this issue Apr 24, 2017 · 8 comments
Closed

kompose passes a kubernetes deployment without image #571

surajssd opened this issue Apr 24, 2017 · 8 comments
Assignees
Labels
component/Kubernetes kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@surajssd
Copy link
Member

I have a docker-compose service with build specified but without image. So since kompose has no build support with kubernetes so it should error out saying that there is no image provided.

$ kompose up
WARN Kubernetes provider doesn't support build key - ignoring 
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead. 
 
INFO Deploying application in "default" namespace 
INFO Successfully created Service: foo            
FATA Error while deploying application: Deployment.apps "foo" is invalid: spec.template.spec.containers[0].image: Required value 

I am using following docker-compose file:

$ cat docker-compose.yml 
version: '2'

services:
  foo:
    build: .

So I would recommend that we suggest user to add one more additional field called image to provide the image name explicitly.

@surajssd surajssd added component/Kubernetes kind/bug Categorizes issue or PR as related to a bug. labels Apr 24, 2017
@procrypt
Copy link
Contributor

@surajssd Working on this.

@cdrage
Copy link
Member

cdrage commented May 4, 2017

I don't believe this is an issue.

If an image key isn't passed, it will use the service name as per how it works in Docker Compose. I work around this in #521 (and thus merging #521 will fix this issue).

For your example, it will build as image "foo".

@surajssd
Copy link
Member Author

surajssd commented May 5, 2017

@cdrage I would not want to do magic here and ask user to specifically provide the image name, because then user might be confused why this is failing!

@cdrage
Copy link
Member

cdrage commented May 5, 2017

@surajssd I don't believe it's magic. This is how Docker Compose does it while building, so I don't see a problem with it converting to Kubernetes and taking the appropriate Docker Image name as the service name.

#521 will be adding the build functionality, so it may be best to wait until that's merged and then we can update this issue #571 in regards to warning the user that in-fact, there was no image specified and it will be using the service name for building / deployment.

@cdrage
Copy link
Member

cdrage commented Aug 3, 2017

@surajssd @procrypt Should we close this? Did my comments address the problem?

@surajssd
Copy link
Member Author

This should fail now right ?

@cdrage
Copy link
Member

cdrage commented Aug 14, 2017

@surajssd No? I thought my comments address why having no image is still valid with build (it builds the docker container and tags it)

@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 3, 2018
@surajssd surajssd closed this as completed Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/Kubernetes kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

5 participants