1

I would like to extend the default "service port range" in K0s Kubernetes distro.

I know that in kubernetes, setting --service-node-port-range option in /etc/kubernetes/manifests/kube-apiserver.yaml will do the trick.

But, how to do so or where is that option in the K0s distro?

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
McLan
  • 2,552
  • 9
  • 51
  • 85

1 Answers1

1

It looks like you could use spec.api.extraArgs to pass the service-node-port-range parameter to api-server.

Spec api:

extraArgs: Map of key-values (strings) for any extra arguments you wish to pass down to Kubernetes api-server process

Example:

apiVersion: k0s.k0sproject.io/v1beta1
kind: Cluster
metadata:
  name: k0s
spec:
  api:
    extraArgs:
      service-node-port-range: 30000-32767
Matt
  • 7,419
  • 1
  • 11
  • 22
  • Trying to apply this I get an error `no matches for kind "Cluster" in version "k0s.k0sproject.io/v1beta1"` – wobmene Sep 24 '21 at 06:38
  • Made `k0s default-config >/etc/k0s.yaml`, `k0s stop`, `k0s reset`, `k0s install controller --config=/etc/k0s.yaml`, added that `extraArgs` to the config, then `k0s start` and it worked – wobmene Sep 24 '21 at 07:26