How to increase the range of ports available to services in kubernetes

Viewed 2044

I want to create a loadBalancer service on kubernetes that exposes a large range of ports. As you can't do that on kubernetes yet (https://github.com/kubernetes/kubernetes/issues/23864).

I have manually entered a range of port by having a yaml file in the following format:

apiVersion: v1
kind: Service
metadata: 
  name: service
spec:
  ports:
  - name: port10000
  port: 10000
  protocol: UDP
    .
    .
    .
  - name: port40000
  port: 40000
  protocol: UDP
  selector: 
    app: app-label
  type: LoadBalancer    

I get the following error:

Error from server (InternalError): error when creating "service-udp.yml": Internal error occurred: failed to allocate a nodePort: range is full

Is it possible to increase the range of ports available for a service? And if so, how?

1 Answers
Related