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

PortalIP assignment #2934

Closed
abonas opened this issue Dec 15, 2014 · 6 comments · Fixed by #5832
Closed

PortalIP assignment #2934

abonas opened this issue Dec 15, 2014 · 6 comments · Fixed by #5832
Labels
area/api Indicates an issue on api area. kind/documentation Categorizes issue or PR as related to documentation. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/network Categorizes an issue or PR as relevant to SIG Network.
Milestone

Comments

@abonas
Copy link
Contributor

abonas commented Dec 15, 2014

According to this page:
https://github.com/GoogleCloudPlatform/kubernetes/blob/5ef34bf52311901b997119cc49eff944c610081b/pkg/api/v1beta3/types.go

"PortalIP is usually assigned by the master. If specified by the user
// we will try to respect it or else fail the request. This field can
// not be changed by updates."
PortalIP string json:"portalIP,omitempty"

  1. just to clarify the above - it means that user is allowed to assign it during creation of service, but not during update service - correct? why update is not supported as well?
  2. what are the considerations for "we will try to respect it" - what validations are made (Except for addr already in use) ?
  3. what exact error is returned when it can't be assigned?
@thockin
Copy link
Member

thockin commented Dec 15, 2014

  1. We did not support update because it is a bit more complicated, but
    mostly because the semantic we want around services is that the IP never
    changes.

  2. We ensure that the IP is within the "portal net" CIDR and not used
    already.

  3. I am 99% sure it returns an HTTP 422 error

On Mon, Dec 15, 2014 at 5:23 AM, abonas notifications@github.com wrote:

According to this page:

https://github.com/GoogleCloudPlatform/kubernetes/blob/5ef34bf52311901b997119cc49eff944c610081b/pkg/api/v1beta3/types.go

"PortalIP is usually assigned by the master. If specified by the user
// we will try to respect it or else fail the request. This field can
// not be changed by updates."
PortalIP string json:"portalIP,omitempty"

  1. just to clarify the above - it means that user is allowed to assign
    it during creation of service, but not during update service - correct? why
    update is not supported as well?
  2. what are the considerations for "we will try to respect it" - what
    validations are made (Except for addr already in use) ?
  3. what exact error is returned when it can't be assigned?

Reply to this email directly or view it on GitHub
#2934.

@abonas
Copy link
Contributor Author

abonas commented Dec 15, 2014

@thockin is there anywhere (or at least planned) the documentation of various errors returned from REST api? I mean beyond the standard 404, 500, etc.
For instance - for duplicate entities, validation errors on entity content, things like the above.
Is there a distinction between wrong json (which should always fail) and the above which is more of a runtime error?
I know some apis (not kubernetes) will actually return 400 in this case and not 422, so declaration of errors will be a great help for consumers of REST api.
(one can always experiment, test and register all those errors, but consider how time consuming that can be)

@bgrant0607 bgrant0607 added area/api Indicates an issue on api area. sig/network Categorizes an issue or PR as relevant to SIG Network. kind/documentation Categorizes issue or PR as related to documentation. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Dec 15, 2014
@bgrant0607
Copy link
Member

We do plan to document and test (and, in some cases, fix) status code behavior: #2174.

@bgrant0607 bgrant0607 added this to the v1.0 milestone Feb 28, 2015
@bgrant0607 bgrant0607 added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed team/cluster labels Feb 28, 2015
@fgrzadkowski
Copy link
Contributor

@bgrant0607 Brian - you added 1.0 milestone to this issue, but I'm not sure what is the action item here. Can you please explain what should be done?

@bgrant0607
Copy link
Member

The action here is/was to verify the behavior and ensure it is documented correctly.

Thanks to @saad-ali we now have general status code behavior documented:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api-conventions.md

It doesn't say what happens in this specific case, though I don't know that it's possible to document every specific case, at least not in a way that's kept up to date.

I can confirm that 422 is returned in this case:
https://github.com/GoogleCloudPlatform/kubernetes/blob/cf68593fc29586f9c98ea4d59b605707ad022075/pkg/registry/service/rest.go#L105

It would be useful to document that users/clients can specify PortalIP in the services doc:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/services.md

@brendandburns brendandburns self-assigned this Mar 23, 2015
@brendandburns
Copy link
Contributor

I'll take the update to services.md and then close this.

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. kind/documentation Categorizes issue or PR as related to documentation. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants