Set Kubelet Parameters Via A Configuration File For RKE/RKE2/K3s Clusters

This document (000021322) is provided subject to the disclaimer at the end of this document.


RKE, RKE2, K3s 


A subset of the kubelet's configuration parameters may be set via an on-disk config file, as a substitute for command-line flags. Providing parameters via a config file is the recommended approach because it simplifies node deployment and configuration management. The examples below cover adding the shutdownGracePeriod and the shutdownGracePeriodCriticalPods via the kubelet configuration file to RKE/RKE2/K3s clusters.


Create the Kubelet configuration file with the parameters on all the nodes of the cluster. For example, create the file at /etc/kubernetes/kubeletconfig.yml

kind: KubeletConfiguration
shutdownGracePeriod: 30s
shutdownGracePeriodCriticalPods: 10s


RKE Clusters
For RKE, in the cluster.yml file, add the extra_bind to mount the file in the Kubelet and then provide the path to the configuration file as an extra_arg like the snippet below.

      config: /etc/kubernetes/kubeletconfig.yml
      - "/etc/kubernetes/kubeletconfig.yml:/etc/kubernetes/kubeletconfig.yml"
Run rke up for the configuration to be applied to the cluster.

RKE2/K3s Clusters
Add the configuration parameter under the Kubelet args in the config file located at /etc/rancher/{rke2|k3s}/config.yaml 
  - "--config=/etc/kubernetes/kubeletconfig.yml"
Restart the rke2/k3s service for the configuration to be applied. 

The Kubelet configuration file needs to be created on all the nodes of the cluster. 


Additional Information


This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021322
  • Creation Date: 14-Jan-2024
  • Modified Date:30-Jan-2024
    • SUSE Rancher

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center