Skip to content

Support port ranges or whole IPs in services #23864

Closed

Description

@adimania

There are several applications like SIP apps or RTP which needs a lot of ports to run multiple calls or media streams. Currently there is no way to allow a range in ports in spec. So essentially I have to do this:

          - name: sip-udp5060
            containerPort: 5060
            protocol: UDP
          - name: sip-udp5061
            containerPort: 5061
            protocol: UDP

Doing above for 500 ports is not pretty. Can we have a way to allow port ranges like 5060-5160?

Activity

  1. bprashanth commented on Apr 6, 2016

    @bprashanth
    Contributor

    Fyi you don't actually need to specify a port in the RC unless you're going to target it through a Service, but I guess this is a pain to do if you have even O(10) ports. I wonder if there's an easy client side solution that doesn't involve changing the Service (something like kubectl expose --port 3000-3020).

  2. thockin commented on Apr 6, 2016

    @thockin
    Member

    The problem with port ranges is that the userspace kube-proxy can't handle
    them, and that is still the fallback path. Until/unless we can totally EOL
    that, we're rather limited.

    Aside from that, I don't immediately see a reason against port ranges.

    On Tue, Apr 5, 2016 at 5:55 PM, Prashanth B [email protected]
    wrote:

    Fyi you don't actually need to specify a port in the RC unless you're
    going to target it through a Service, but I guess this is a pain to do if
    you have even O(10) ports. I wonder if there's an easy client side solution
    that doesn't involve changing the Service (kubectl expose --ports
    3000-3001).

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly or view it on GitHub
    #23864 (comment)

  3. adimania commented on Apr 6, 2016

    @adimania
    ContributorAuthor

    I do need to target the ports through a Service since that is the only way outside users would be able to place a call via SIP

  4. thockin commented on Apr 6, 2016

    @thockin
    Member

    The short story is it doesn't work right now. Changing it is not
    impossible, but we would need to define what happens when the external LB
    and/or kube-proxy doesn't support ranges. It's not on the roadmap, though,
    so it would either have to be contributed or escalated.

    On Tue, Apr 5, 2016 at 9:01 PM, Aditya Patawari [email protected]
    wrote:

    I do need to target the ports through a Service since that is the only way
    outside users would be able to place a call via SIP

    —
    You are receiving this because you commented.
    Reply to this email directly or view it on GitHub
    #23864 (comment)

  5. antonmry commented on May 8, 2016

    @antonmry

    I'm starting to work in this issue. I will try to implement just the logic in kubctl package to map the port ranges to ports which seems a easy and useful workaround. Later I will check the LB and/or kube-proxy option.

    golang and kubernetes are new for me so any help, ideas or guidance will be welcomed.

  6. lavalamp commented on May 16, 2016

    @lavalamp
    Contributor

    @antonmry What API changes are you looking to do to support this? I glanced at your dev branch and it looks like there's a lot more copy-paste going on than I'd expect. I think I can save you effort if you talk out your desired changes here first.

  7. thockin commented on May 16, 2016

    @thockin
    Member

    This change, should we decide to do it, doesn't warrant a new API. It's just some field changes to Services and maybe Pods. The right place to start is with a proposal doc that details the change, the API compatibility concerns, the load-balancer implementation concerns, etc.

  8. brendandburns commented on May 16, 2016

    @brendandburns
    Contributor

    @bgrant0607 @antonmry needs this change to make TeleStax (an RTC framework) work well in Kubernetes, so this isn't a "for fun" request, but rather one that's needed to support their application well.

    I agree w/ @lavalamp and @thockin that there are simpler designs, and that a lightweight design proposal is the right way to get to agreement on design quickly.

  9. changed the title [-]Cannot allow a port range in replication controller[/-] [+]Cannot allow a port range in service[/+] on May 16, 2016
  10. changed the title [-]Cannot allow a port range in service[/-] [+]Support port ranges in services[/+] on May 16, 2016
  11. 229 remaining items

  12. removed
    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.
    on Jul 4, 2025
  13. k8s-triage-robot commented on Jul 4, 2026

    @k8s-triage-robot

    This issue has not been updated in over 1 year, and should be re-triaged.

    You can:

    • Confirm that this issue is still relevant with /triage accepted (org members only)
    • Close this issue with /close

    For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

    /remove-triage accepted

  14. added
    needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.
    and removed
    triage/acceptedIndicates an issue or PR is ready to be actively worked on.
    on Jul 4, 2026
  15. danwinship commented on Jul 16, 2026

    @danwinship
    Contributor

    I am tempted to close this; it's been open for a decade and there has been no progress. Clearly this issue is not actually helping anyone.

    From kubernetes/enhancements#6220:

    We need someone to draw up a complete end-to-end picture of what they think "SIP/RTP in Kubernetes" should look like, how the servers are deployed and configured, how packets get routed from client to server and back, etc. And for each part of that that requires some new feature that doesn't exist today, explain why the features that exist today wouldn't work, and why the proposed feature seems like the right fix. And then we need other people to say "yes, I want to deploy clusters like that as well", or else "no, that won't work in my environment, I need this part to work like this..." etc.

  16. bowei commented on Jul 16, 2026

    @bowei
    Member

    /close

  17. kubernetes-prow commented on Jul 16, 2026

    @kubernetes-prow
    Contributor

    @bowei: Closing this issue.

    Details

    In response to this:

    /close

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

  18. SixFive7 commented on Jul 16, 2026

    @SixFive7

    Well that is a shame. I'm rather depended on this feature as the current workaround for scripts creating huge files is a pain. But unfortunately I do not have the experience to help the implementation along...

  19. briantopping commented on Jul 16, 2026

    @briantopping
    Contributor
  20. danwinship commented on Jul 16, 2026

    @danwinship
    Contributor

    I suspect the reason it stayed open for this long is there was always an emergent solution at hand

    And I think that's also why every attempt to do anything with this failed: everyone coming here already had a hacky solution for 80% of the problem, and they imagined that this issue would solve the remaining 20% for them. But everybody had a different hacky 80% solution, and so they were all imagining a slightly different remaining 20%. (That showed up in the earlier KEP attempt, where there were some people who assumed that "port ranges in Services" also implied "port ranges in LoadBalancers", while other people assumed that the feature would only be used with ClusterIPs, and others only cared about hostNetwork pods...)

    And SIG Network doesn't want to add a feature that is only useful as the last 20% of a hacky solution anyway. We want to provide the 100% doesn't-need-any-hacks solution (and are still open to doing so, if people want to come up with that solution!)

  21. rafasc commented on Jul 16, 2026

    @rafasc

    there was always an emergent solution at hand.

    Unfortunately, at least a couple of times in projects I've been involved in, the emergent solution was not the 80% hack, but rather not to do it in k8s (FTP,SIP). Once that decision is made, it becomes harder to contribute back because there is nothing to increment from.

    The remaining 20% is very hard to achieve because the requirements to make FTP work are not the same as SIP or other multi-connection protocols, in terms of load balancing, session affinity, etc. The port range is just the common part of issues with all these protocols.

    I understand the close probably just means there isn't a consensus on the solution, but I just wanted to add my two cents that there is still interest in the solution by people like me who are/were in silence because they do not have the expertise in all those domains/protocols simultaneously to tackle this.

  22. thockin commented on Jul 16, 2026

    @thockin
    Member

    We closed it because after 10 years it hasn't been important enough to anyone to solve, but we have to re-triage it over and over. If someone wants to work on it, it can be reopened.

  23. agowa commented on Sep 25, 2026

    @agowa

    @thockin that's not quite true. It has been addressed within multiple CNIs. It's just more of a hacky workaround than a true fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/kube-proxykind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.priority/backlogHigher priority than priority/awaiting-more-evidence.sig/networkCategorizes an issue or PR as relevant to SIG Network.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions