[Solved] Setting Max Pods

How do you change the Max Pods after you have created a cluster?

How do you set the Max Pods before you create a new cluster?

At 110 max pods, it’s hit very quickly with plenty of hardware resources left for two or three folds more pods.

Update: See superseb’s answer


addon_job_timeout: 30
  strategy: "x509"
ignore_docker_version: true
#   # Currently only nginx ingress provider is supported.
#   # To disable ingress controller, set `provider: none`
#   # To enable ingress on specific nodes, use the node_selector, eg:
#      provider: nginx
#      node_selector:
#        app: ingress
  provider: "nginx"
kubernetes_version: "v1.11.3-rancher1-1"
  provider: "metrics-server"
#   # If you are using calico on AWS
#      network:
#        plugin: calico
#        calico_network_provider:
#          cloud_provider: aws
#   # To specify flannel interface
#      network:
#        plugin: flannel
#        flannel_network_provider:
#          iface: eth1
#   # To specify flannel interface for canal plugin
#      network:
#        plugin: canal
#        canal_network_provider:
#          iface: eth1
    flannel_backend_type: "vxlan"
  plugin: "canal"
#      services:
#        kube_api:
#          service_cluster_ip_range:
#        kube_controller:
#          cluster_cidr:
#          service_cluster_ip_range:
#        kubelet:
#          cluster_domain: cluster.local
#          cluster_dns_server:
      heartbeat-interval: 500
      election-timeout: 5000
    snapshot: false
    pod_security_policy: false
    service_node_port_range: "30000-32767"
      max-pods: 500
ssh_agent_auth: false
1 Like

You can configure anything using https://rancher.com/docs/rke/v0.1.x/en/config-options/ (specifically https://rancher.com/docs/rke/v0.1.x/en/config-options/services/services-extras/#extra-args) and https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#config-file

I can’t seem to find any configuration flags for “max pods” or “max” and “pods”

The parameter extra_args lets you add any argument to any service. Also see https://github.com/rancher/docs/pull/851/files


That was the perfect example. That was more clear than the links to the other documentation!


Well this seems to be the solution to my problem, but where the heck is this file located?? Can it be edited through the Rancher 2.x web interface? Do I have to edit a file locally on the node where Rancher is running?

I searched google for hours and cant seem to find the right way to do this :sob:

Ok I finally found it. You can edit it though the Rancher 2.x web ui but only using the yaml editor. To do this:

  • Open your cluster dashboard of choice
  • Open Options […] -> Edit
  • Click the Edit as YAML button
  • Find the services section
  • Find the kubelet section
  • Add the following to it:
      fail_swap_on: false
        max-pods: '250'

This is still a problem since you don’t get this option in imported clusters. When you go to edit cluster you only have
member roles
Labels and annotations. We have 1% memory used and 3% CPU used with 80% pod limit reached already. Very frustrating.

1 Like

I’m not able to verify that, but that does sound frustrating

I’m in the process of deploying Rancher using rke + letsencrypt, but hitting a wall where the certificates aren’t properly created, or is in some staging phase

Not sure yet

Imported clusters are defined and managed by whatever created them, and you’d need to change the setting there. Rancher only has access to the resources “inside” of the cluster; it has no idea what created the “outside” of the cluster itself, doesn’t know how to change its configuration, and doesn’t have the credentials that may be needed to change it.