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

Kubernetes do not support publish all exposed ports to random ports #43564

Closed
gyliu513 opened this issue Mar 23, 2017 · 4 comments
Closed

Kubernetes do not support publish all exposed ports to random ports #43564

gyliu513 opened this issue Mar 23, 2017 · 4 comments
Labels
sig/network Categorizes an issue or PR as relevant to SIG Network.

Comments

@gyliu513
Copy link
Contributor

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.):

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Kubernetes version (use kubectl version):
master

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:
Currently in Kubernetes, if I want to enable the docker host port mapping, I have to write the hostPort explicitly in the yaml template and kubernetes cannot publish the host ports to random ports like docker does in docker run -P.

    ports:
    - containerPort: 2381
      hostPort: 2381
      name: serverport
      protocol: TCP
    - containerPort: 4002
      hostPort: 4002
      name: clientport
      protocol: TCP

This is not convenient for some customers who want to use docker's port mapping feature as the end user need to set the hostPort by themselves and this may cause some port conflict especially when scale up a pod on same node. Yes, we can workaround the scale up issue with pod anti affinity feature, but it is not convenient to let end user write those hostPorts for a large deployment with many exposed hostPort.

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

@gyliu513
Copy link
Contributor Author

For the Kubernetes native NodePort, the problem is that the customer only want to access the specified pod with node IP (where the pod is running) + host port mapping as they already have a haproxy outside the Kubernetes cluster and they do not want the NodePort load balance as it may access pods in other nodes.

@gyliu513
Copy link
Contributor Author

After some discussion in sig-network, there are also some people have the similar requirement of want an external load balancer to communicate with pod directly, instead of passing through nodePort/clusterIP. Currently they can only specify different hostPort to different deployments. Letting kubernetes to automatically assign hostPort for different deployment (or maybe service?) will be quite useful.

@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label May 31, 2017
@gyliu513
Copy link
Contributor Author

gyliu513 commented Jun 2, 2017

/sig network

@k8s-ci-robot k8s-ci-robot added the sig/network Categorizes an issue or PR as relevant to SIG Network. label Jun 2, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 2, 2017
@gyliu513
Copy link
Contributor Author

Close this one and trace it in #40131

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

No branches or pull requests

3 participants