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

REST api - can a pod without containers be created? #4932

Closed
abonas opened this issue Mar 1, 2015 · 14 comments · Fixed by #5609 or #5703
Closed

REST api - can a pod without containers be created? #4932

abonas opened this issue Mar 1, 2015 · 14 comments · Fixed by #5609 or #5703
Assignees
Labels
area/api Indicates an issue on api area. area/usability priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Milestone

Comments

@abonas
Copy link
Contributor

abonas commented Mar 1, 2015

I tried to create a pod without containers to see if it's supported or not. (does a pod without containers have a meaning in k8s?)
I was getting "conflict 409 already exists" error although I used a new pod with a new name/id, so it's not clear whether it's supported or not, and whether this error is a mistake (409 instead of 400)

@bronislav
Copy link
Contributor

What is the reason to create pod without specifiing image / creating container? Please provide a use case when such functionality is necessry.

@abonas
Copy link
Contributor Author

abonas commented Mar 1, 2015

@bronislav - to me it's not necessary. However if it's not supported, a validation should prevent it not to allow corrupted entities. And if it is supported, it will be good to understand why.
For instance, service with nil selector is supported, though it might not make sense to some users.
see this: #3712

@bgrant0607
Copy link
Member

Yes, it should be allowed, and I'm pretty sure it used to work. Could you please post your object schema here or somewhere?

@bgrant0607 bgrant0607 added kind/support Categorizes issue or PR as a support question. priority/support sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Mar 1, 2015
@bgrant0607 bgrant0607 self-assigned this Mar 1, 2015
@abonas
Copy link
Contributor Author

abonas commented Mar 1, 2015

@bgrant0607 what do you mean by object schema? an example json of such pod or something broader?
and btw what meaning a pod has without containers?

@abonas
Copy link
Contributor Author

abonas commented Mar 3, 2015

cc @itamarh @simon3z

@bgrant0607
Copy link
Member

@dchen1107 @thockin I'm fine with banning this for now. The use cases where it would be useful (e.g., reserving resources, staging deployment, prefetching images, ...) aren't currently well supported. When we add the features that could take advantage of this (e.g., pod-level resources, additional of containers during update, container volumes, pod/volume init hooks), then we can make it legal again at that point.

@bgrant0607 bgrant0607 removed their assignment Mar 6, 2015
@bgrant0607 bgrant0607 added priority/backlog Higher priority than priority/awaiting-more-evidence. area/api Indicates an issue on api area. area/usability and removed kind/support Categorizes issue or PR as a support question. priority/support labels Mar 6, 2015
@bgrant0607 bgrant0607 added this to the v1.0 milestone Mar 6, 2015
@abonas
Copy link
Contributor Author

abonas commented Mar 6, 2015

@bgrant0607 in that case, a clear error message coming from REST would be in place when a pod with no containers is recieved by the server :)

@fgrzadkowski fgrzadkowski self-assigned this Mar 9, 2015
@fgrzadkowski
Copy link
Contributor

I'll look into this.

@bgrant0607 AFAIU we want to return meaningful error if user specifies pod with no containers. Is my understanding correct?

@bgrant0607
Copy link
Member

@abonas
Copy link
Contributor Author

abonas commented Mar 11, 2015

cc @mfojtik

@yujuhong
Copy link
Contributor

@bgrant0607, should we document this somewhere (e.g. api/v1betaX/types.go?). Validation is not versioned, so any change would apply to all existing APIs.

@bgrant0607
Copy link
Member

Yes, it should be documented, in the field descriptions, such as:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/v1beta3/types.go#L566

@fgrzadkowski
Copy link
Contributor

I'll send a PR for this.

@abonas
Copy link
Contributor Author

abonas commented Mar 26, 2015

cc @zeari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue on api area. area/usability priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
5 participants