WolfiG
WolfiG

Reputation: 1163

Kubernetes loses enhanced range of service ports

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

System environment:

I start the minikube from a shell script via

minikube start --extra-config=apiserver.service-node-port-range=3000-61616

The minikube responds with

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"

So I assume the the service ports 3000-61616 ARE available in the minikube.

Some shell script lines down the road I create the Grafana service by applying the yaml 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

Which yields:

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

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.

Now some questions:

Upvotes: 2

Views: 1168

Answers (1)

Nick Aberle
Nick Aberle

Reputation: 164

I was hitting this as well on mac. The key was running minikube delete and then running minikube start --extra-config=apiserver.service-node-port-range=3000-61616 again.

This was with the Docker driver, not hyperkit FWIW.

Upvotes: 4

Related Questions