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

Multi-Port Servers in Services v2 #1802

Closed
enisoc opened this issue Oct 15, 2014 · 11 comments
Closed

Multi-Port Servers in Services v2 #1802

enisoc opened this issue Oct 15, 2014 · 11 comments
Assignees
Labels
area/api Indicates an issue on api area. area/usability kind/design Categorizes issue or PR as related to design. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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. sig/node Categorizes an issue or PR as relevant to SIG Node.
Milestone

Comments

@enisoc
Copy link
Member

enisoc commented Oct 15, 2014

I'm running ZooKeeper, which requires every server to know about every other server at startup (this will be fixed in 3.5.0, but that's still in alpha). In addition, each server needs to expose two different ports: a leader port and an election port. I've been using a model in which every ZooKeeper instance gets two services -- one for each port. Each such service then has only one pod matching its selector.

For example:

pods/zk1
pods/zk2
...
services/zk1-leader
services/zk1-election
services/zk2-leader
services/zk2-election
...

With Services v2, I won't be able to do that, because if I create two services for one instance, they will have different IPs. There's no way to tell ZooKeeper to use a different IP to connect to the leader port vs. the election port of a given server.

Since a service in v2 will have its own IP address, can we maybe have the ability to define multiple ports on a single service? Or is there a better way to handle this kind of use case?

@bgrant0607 bgrant0607 added area/api Indicates an issue on api area. sig/network Categorizes an issue or PR as relevant to SIG Network. kind/design Categorizes issue or PR as related to design. labels Oct 15, 2014
@bgrant0607
Copy link
Member

Yes, many applications do use multiple ports, including our internal equivalents to Zookeeper.

Option 1: Multiple named ports per service (potentially of different protocols)

I would still produce multiple Endpoints lists and multiple SRV records (once we have DNS integrated), one for each port. Of course, we would generate multiple sets of Docker links variables, as well, one for each port.

Pros:

  • Fairly simple to specify and understand
  • Similar to pod spec
  • No new API objects
  • No redundant IPs and DNS names required
  • Compatible with SRV
  • Simplifies cardinal services (PetSet (was nominal services) #260)
  • Similar to what we do internally

Cons:

  • Adds another name component
  • May encourage coupling of logically independent services (e.g., ports from separate containers in a pod) in order to conserve IP addresses

Option 2: Split IP assignment and Port declarations into separate API objects

Pros:

  • More accurately models the mechanisms
  • Keeps the separate services decoupled

Cons:

  • More complicated model

In this case, I think worse is better. I favor option 1.

/cc @thockin

@mindscratch
Copy link

+1 -- just following along as I'm trying to do the same thing.

@erictune
Copy link
Member

On this stackoverflow issue a kubernetes user wants to run an application which dynamically allocates ports. Currently, the user is creating a service for each port in the range which might be used, which seems like a waste of IPs and a lot of redundant config.
It would help the user's case if there was a way to specify "all ports" or perhaps a range of ports.

@splix
Copy link

splix commented Dec 23, 2014

Exactly same problem with RabbitMQ, need 3 ports to expose

@Pindar
Copy link

Pindar commented Jan 19, 2015

+1

@bgrant0607
Copy link
Member

Discussion is happening on #2585. We'd appreciate feedback from users with multi-port services, especially if you plan to query the Endpoints API to discover targets/peers of the multi-port service.

@bgrant0607 bgrant0607 modified the milestone: v1.0 Feb 6, 2015
@davidopp davidopp added sig/node Categorizes an issue or PR as relevant to SIG Node. team/cluster sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Feb 17, 2015
@thockin thockin added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels Feb 17, 2015
@thockin
Copy link
Member

thockin commented Apr 1, 2015

Multi-port services is in! Happy zookeeping.

@thockin thockin closed this as completed Apr 1, 2015
@phemmer
Copy link

phemmer commented Apr 1, 2015

Looks like this was implemented in #5939 & #6182 for anyone interested.

@jk-shah
Copy link

jk-shah commented Apr 14, 2015

Great!! We just ran into this.. Which version of Kubernetes has this checkin? Any easy way to figure that out?

UPDATE: Saw it is in 0.15RC - https://github.com/GoogleCloudPlatform/kubernetes/releases/tag/v0.15.0

@mikedanese
Copy link
Member

This is in the 0.15.0 release.

@jk-shah
Copy link

jk-shah commented Apr 14, 2015

Thanks

QiWang19 pushed a commit to QiWang19/kubernetes that referenced this issue Dec 1, 2023
[release-4.13] OCPBUGS-23287: UPSTREAM: 121881: Use golang library instead of mklink
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 kind/design Categorizes issue or PR as related to design. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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. sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet
Development

No branches or pull requests