<p>I wanted to expose my application on all the ports between 3000-14000. For this, I have changed the default nodePort range 30k - 32767 by updating kubeapi-server manifest file field "--service-node-port-range=3000-14000". For me, it is almost impossible to expose by specifying all the port numbers manually following the below template.</p>

<pre><code>apiVersion: v1
kind: Service
metadata: 
   name: myapp-service
spec:
  type: nodePort
  selector:
   app: myapp
  ports:
  - targetPort: 3000
    port: 3000
    nodePort: 3000
  ...................
  ...................
 - targetPort: 14000
    port: 14000
    nodePort: 14000
</code></pre>

<p>Do we have any other alternative solution/plugins to this, so as to open all ports between the range 3k - 14k.</p>

vidyadhar reddy
<p>Unfortunately Kubernetes doesn't yet support <a href="https://github.com/kubernetes/kubernetes/issues/23864" rel="nofollow noreferrer">exposing range of ports</a> (it's possible in <a href="https://stackoverflow.com/questions/28717464/docker-expose-all-ports-or-range-of-ports-from-7000-to-8000">Docker</a>).</p>

<p>As a workaround use <a href="https://helm.sh/docs/topics/chart_best_practices/templates/" rel="nofollow noreferrer">Helm templates</a> to create chart with service template and ports in values.yaml file. Or create a script to automate creation of a service yaml to expose each port.</p>
