-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Implement multi-port Services #6182
Conversation
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run hack/update-swagger-spec.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done for next
@@ -750,6 +752,35 @@ type Service struct { | |||
|
|||
// Optional: Supports "ClientIP" and "None". Used to maintain session affinity. | |||
SessionAffinity AffinityType `json:"sessionAffinity,omitempty" description:"enable client IP based session affinity; must be ClientIP or None; defaults to None"` | |||
|
|||
// Optional: Ports to expose on the service. If this field is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, the long source comment isn't discoverable by users. I'd prefer to have any relevant details in the description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grammar rules? Are these full sentences?
Thanks a lot for plowing through this. API LGTM, and a read through all the code LGTM, also. Is there a snowball's chance we could quickly agree on a resolution to #4811? Do you plan to punt multiple ports in other cloudproviders to later? I'd be fine with filing issues. In the meantime, errors for unsupported use cases would be nice if not too hard. |
// Required: Supports "ClientIP" and "None". Used to maintain session affinity. | ||
SessionAffinity AffinityType `json:"sessionAffinity,omitempty"` | ||
} | ||
|
||
type ServicePort struct { | ||
// Optional if only one ServicePort is defined on this service: The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, isn't the first port allowed to be nameless, regardless how many ports there are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of the system won't differentiate whether it is the first port or not,
but validation enforces it.
On Mon, Mar 30, 2015 at 2:04 PM, Brian Grant notifications@github.com
wrote:
In pkg/api/types.go
#6182 (comment)
:// Required: Supports "ClientIP" and "None". Used to maintain session affinity. SessionAffinity AffinityType `json:"sessionAffinity,omitempty"`
}
+type ServicePort struct {
- // Optional if only one ServicePort is defined on this service: The
Technically, isn't the first port allowed to be nameless, regardless how
many ports there are?—
Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/6182/files#r27431745
.
a09a5e5
to
f00dabc
Compare
I'll @ the people who own the other providers. On Mon, Mar 30, 2015 at 2:02 PM, Brian Grant notifications@github.com
|
@@ -515,7 +515,7 @@ func (lb *LoadBalancer) CreateTCPLoadBalancer(name, region string, externalIP ne | |||
|
|||
_, err = members.Create(lb.network, members.CreateOpts{ | |||
PoolID: pool.ID, | |||
ProtocolPort: port, | |||
ProtocolPort: ports[0], //FIXME: need to handle multi-port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anguslees Could use advice on how to implement multi-port for openstack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no multiport feature in OpenStack LBaaS - so we'll need to create a new VIP with a new Pool (and new Pool Members) for each port. Basically just put a loop around this function body.
Urgh, no it isn't that easy because then you won't have a 1:1 with k8s' LoadBalancer name
and the OpenStack VIPs, which will break the other TCPLoadBalancer
methods. Assign me a followon bug and I'll have to come up with something involving regexes and non-atomic operations :(
It looks to me like the GCE change above for this implements a port range - is this the intended multiport semantics, or just an easy implementation? (neither interpretation exists in OpenStack, just wondering which one I should implement)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCE only supports a range. It's not ideal, but it works. If I were implementing I would do both. e.g. "80,443,8000-9000" :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make this return an error for now. Thanks.
@@ -103,18 +135,50 @@ | |||
"description": "API at /api/v1beta1 version v1beta1", | |||
"operations": [ | |||
{ | |||
"type": "v1beta1.EndpointsList", | |||
"type": "*json.watchEvent", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like fallout from @smarterclayton's watch changes.
- watchEvent looks like a backdoor unversioned API type (from watch/json/types.go) that's not supposed to be public
- I'm not sure the
*
syntax works -- it may well break swagger validation, which currently passes - We've lost documentation of the watch payload type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I 'm not sure if/what you're asking me to do here :)
On Mon, Mar 30, 2015 at 5:17 PM, Brian Grant notifications@github.com
wrote:
In api/swagger-spec/v1beta1.json
#6182 (comment)
:@@ -103,18 +135,50 @@
"description": "API at /api/v1beta1 version v1beta1",
"operations": [
{
"type": "v1beta1.EndpointsList",
"type": "*json.watchEvent",
Looks like fallout from @smarterclayton
https://github.com/smarterclayton's watch changes.
- watchEvent looks like a backdoor unversioned API type (from
watch/json/types.go) that's not supposed to be public- I'm not sure the * syntax works -- it may well break swagger
validation, which currently passes- We've lost documentation of the watch payload type
—
Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/6182/files#r27444231
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Mar 30, 2015, at 8:17 PM, Brian Grant notifications@github.com wrote:
In api/swagger-spec/v1beta1.json:
@@ -103,18 +135,50 @@
"description": "API at /api/v1beta1 version v1beta1",
"operations": [
{
"type": "v1beta1.EndpointsList",
Looks like fallout from @smarterclayton's watch changes."type": "*json.watchEvent",
watchEvent looks like a backdoor unversioned API type (from watch/json/types.go) that's not supposed to be public
It's versioned, but we could not run conversion at the time it was created because of limitations in the underlying conversion method. It is the real object that you get when you watch. Probably can just create a type alias.I'm not sure the * syntax works -- it may well break swagger validation, which currently passes
Type aliasing should clear that up.
We've lost documentation of the watch payload type
Technically... there are multiple watch payload types. Status and the local Kind. I'd err on the side of describing both.
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll handle it.
On Mar 30, 2015, at 8:25 PM, Tim Hockin notifications@github.com wrote:
In api/swagger-spec/v1beta1.json:
@@ -103,18 +135,50 @@
"description": "API at /api/v1beta1 version v1beta1",
"operations": [
{
"type": "v1beta1.EndpointsList",
I 'm not sure if/what you're asking me to do here :)"type": "*json.watchEvent",
…
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spawned #6232 for this.
----- Original Message -----
@@ -103,18 +135,50 @@
"description": "API at /api/v1beta1 version v1beta1",
"operations": [
{
"type": "v1beta1.EndpointsList",
"type": "*json.watchEvent",
Looks like fallout from @smarterclayton's watch changes.
- watchEvent looks like a backdoor unversioned API type (from
watch/json/types.go) that's not supposed to be public- I'm not sure the
*
syntax works -- it may well break swagger validation,
which currently passes- We've lost documentation of the watch payload type
Reply to this email directly or view it on GitHub:
https://github.com/GoogleCloudPlatform/kubernetes/pull/6182/files#r27444231
c0f90ff
to
d5be5dc
Compare
d5be5dc
to
eeff1b7
Compare
@thockin this is breaking backwards comp of service entity, right? (just want to make sure we're on the same page) |
@abonas Mostly this just breaks v1beta3 backwards compatibility. |
LGTM |
will need to rebase before merge, e2e is running now |
e2e passed |
Fire in the hole! |
Implement multi-port Services
probably should have squashed :) |
name: "remove portal IP", | ||
tweakSvc: func(oldSvc, newSvc *api.Service) { | ||
oldSvc.Spec.PortalIP = "1.2.3.4" | ||
newSvc.Spec.PortalIP = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tim, I have a issue #5907 related to this part. newSvc.Spec.PortalIP = ""
usually happens when portalIP is not given in the template. Since when creating a service not giving a portalIP means allow kubernetes automatically allocate one, I think we should keep this semantic while updating. That is use the system allocated one. For removing portalIP, if allowed later, we can use something like portalIP: None
explicitly in the template. What do you think?
There are still a few things to do here, but it builds and passes unit tests.
While this is up for review I will do manual testing, finish last nits, and get an e2e run. As before, please focus on API, conversions, defaults - as these are most likely to go wrong, IMO.