<p>I am testing an kubernetes minikube/influxdb/grafana stack under macos 10.15.3. I am working on the command line.</p>

<p>System environment:</p>

<ul>
<li>MacOS 10.15.3 /bin/bash (darwin19)</li>
<li><p>Minikube 1.7.2, downloaded via</p>

<p><code>curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64</code></p></li>
</ul>

<p>I start the minikube from a shell script via</p>

<pre><code>minikube start --extra-config=apiserver.service-node-port-range=3000-61616
</code></pre>

<p>The minikube responds with</p>

<pre><code>Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.17.2 on Docker 19.03.5 ...
    ▪ apiserver.service-node-port-range=3000-61616
🚀  Launching Kubernetes ...
🌟  Enabling addons: default-storageclass, storage-provisioner
⌛  Waiting for cluster to come online ...
🏄  Done! kubectl is now configured to use "minikube"
</code></pre>

<p>So  I assume the the service ports 3000-61616 ARE available in the minikube.</p>

<p>Some shell script lines down the road I create the Grafana service by applying the yaml code:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: grafana
  namespace: default
spec:
  selector:
    app: grafana
  type: NodePort
  ports:
    - protocol: TCP
      port: 3000
      targetPort: 3000
      nodePort: 3000
</code></pre>

<p>Which yields:</p>

<pre><code>The Service "grafana" is invalid: spec.ports[0].nodePort: Invalid value: 3000: provided port is not in the valid range. The range of valid ports is 30000-32767
</code></pre>

<p>As it seems, the service port range gets reset somehow. The Grafana deployment and other deployments, and influxDB and telegraf services (not of type "NodePort"!) do not cause problems. The same code does not cause these kind of problems on a standard linux-system.</p>

<p>Now some questions:</p>

<ul>
<li>How can I display the current status of the service node port range?</li>
<li>Why/where could the service range be changed?</li>
<li>As a workaround: how can I update the service port range in a running node/kube-api?</li>
</ul>

<p>I was hitting this as well on mac. The key was running <code>minikube delete</code> and then running <code>minikube start --extra-config=apiserver.service-node-port-range=3000-61616</code> again.</p>
<p>This was with the Docker driver, not hyperkit FWIW.</p>
