About how to expand Node Port range?

I refer to the documentation for cluster installation in Helm HA mode. Node ports in clusters are now limited to 30000-32768. I would like to ask how to remove this restriction?

Thank you very much!

It’s in the config yaml, but it needs to be a contiguous range of ports that are all available. I.e. you probably don’t want to make it contain anything low. The standard range is 30000-32767 because 32768-61000 is the standard kernel ephemeral range, and 2,768 ports is generally enough.

https://rancher.com/docs/rke/latest/en/config-options/services/#kubernetes-api-server

Because of I use Helm HA installation type to setup rancher cluster. So i can’t find the api-server yaml file.

The standard way to do HA is to create a cluster with RKE, which has a cluster config yaml, which is what those docs are for. If you’re making it some other way then your need to configure it there.

I refer to the installation document of the official website for installation. It is installed using rke. My rancher is version 2.2.4. When using RKE for k8s installation, the relevant information is as follows

-------------------------- rancher-cluster.yml
nodes:

  • address: 192.168.0.181
    user: docker
    role: [controlplane,worker,etcd]
  • address: 192.168.0.182
    user: docker
    role: [controlplane,worker,etcd]
  • address: 192.168.0.183
    user: docker
    role: [controlplane,worker,etcd]
  • address: 192.168.0.194
    user: docker
    role: [worker]
  • address: 192.168.0.195
    user: docker
    role: [worker]
  • address: 192.168.0.196
    user: docker
    role: [worker]

services:
etcd:
backup_config:
enabled: true # enables recurring etcd snapshots
interval_hours: 6 # time increment between snapshots
retention: 60 # time in days before snapshot purge

And that as an option you can add to your rancher-cluster.yml

Add in the rancher-cluster.yml and in services section?Like this ?


services:
etcd:
backup_config:
enabled: true # enables recurring etcd snapshots
interval_hours: 6 # time increment between snapshots
retention: 60 # time in days before snapshot purge
kube-api:
service_node_port_range: 30000-32767
pod_security_policy: false

can it work in rancher 2.2.4?

It is ok. Thank you very much