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?

1 Answer 1

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
2
  • Trying to apply this I get an error no matches for kind "Cluster" in version "k0s.k0sproject.io/v1beta1"
    – wobmene
    Sep 24, 2021 at 6: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, 2021 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.