Skip to main content

Agent Configuration Reference

This is a reference to all parameters that can be used to configure the rke2 agent. Note that while this is a reference to the command line arguments, the best way to configure RKE2 is using the configuration file.

Common

FlagDescriptionDefaultEnviroment Variable
configPath to config file/etc/rancher/rke2/config.yamlRKE2_CONFIG_FILE
debugTurn on debug logsRKE2_DEBUG
data-dirFolder to hold state"/var/lib/rancher/rke2"

Cluster

FlagDescriptionEnviroment Variable
tokenToken to use for authenticationRKE2_TOKEN
token-fileToken file to use for authenticationRKE2_TOKEN_FILE
serverServer to connect toRKE2_URL

Node

FlagDescriptionDefaultEnviroment Variable
node-nameNode nameRKE2_NODE_NAME
with-node-idAppend id to node name
node-labelRegistering and starting kubelet with set of labels
node-taintRegistering kubelet with set of taints
image-credential-provider-bin-dirThe path to the directory where credential provider plugin binaries are located"/var/lib/rancher/credentialprovider/bin"
image-credential-provider-configThe path to the credential provider plugin config file"/var/lib/rancher/credentialprovider/config.yaml"
selinuxEnable SELinux in containerdRKE2_SELINUX
lb-server-portLocal port for supervisor client load-balancer. If the supervisor and apiserver are not colocated an additional port 1 less than this port will also be used for the apiserver client load-balancer.6444RKE2_LB_SERVER_PORT
protect-kernel-defaultsKernel tuning behavior. If set, error if kernel tunables are different than kubelet defaults.

Runtime

FlagDescriptionDefault
container-runtime-endpointDisable embedded containerd and use the CRI socket at the given path; when used with --docker this sets the docker socket path
default-runtimeSet the default runtime in containerd
snapshotterOverride default containerd snapshotter"overlayfs"
private-registryPrivate registry configuration file"/etc/rancher/rke2/registries.yaml"

Containerd

FlagDescription
disable-default-registry-endpointDisables containerd's fallback default registry endpoint when a mirror is configured for that registry

Networking

FlagDescriptionEnviroment Variable
node-ipIPv4/IPv6 addresses to advertise for node
node-external-ipIPv4/IPv6 external IP addresses to advertise for node
resolv-confKubelet resolv.conf fileRKE2_RESOLV_CONF

Components

FlagDescriptionEnviroment Variable
kubelet-argCustomized flag for kubelet process
kube-proxy-argCustomized flag for kube-proxy process
control-plane-resource-requestsControl Plane resource requestsRKE2_CONTROL_PLANE_RESOURCE_REQUESTS
control-plane-resource-limitsControl Plane resource limitsRKE2_CONTROL_PLANE_RESOURCE_LIMITS
control-plane-probe-configurationControl Plane Probe configurationRKE2_CONTROL_PLANE_PROBE_CONFIGURATION
kube-apiserver-extra-mountkube-apiserver extra volume mountsRKE2_KUBE_APISERVER_EXTRA_MOUNT
kube-scheduler-extra-mountkube-scheduler extra volume mountsRKE2_KUBE_SCHEDULER_EXTRA_MOUNT
kube-controller-manager-extra-mountkube-controller-manager extra volume mountsRKE2_KUBE_CONTROLLER_MANAGER_EXTRA_MOUNT
kube-proxy-extra-mountkube-proxy extra volume mountsRKE2_KUBE_PROXY_EXTRA_MOUNT
etcd-extra-mountetcd extra volume mountsRKE2_ETCD_EXTRA_MOUNT
cloud-controller-manager-extra-mountcloud-controller-manager extra volume mountsRKE2_CLOUD_CONTROLLER_MANAGER_EXTRA_MOUNT
kube-apiserver-extra-envkube-apiserver extra environment variablesRKE2_KUBE_APISERVER_EXTRA_ENV
kube-scheduler-extra-envkube-scheduler extra environment variablesRKE2_KUBE_SCHEDULER_EXTRA_ENV
kube-controller-manager-extra-envkube-controller-manager extra environment variablesRKE2_KUBE_CONTROLLER_MANAGER_EXTRA_ENV
kube-proxy-extra-envkube-proxy extra environment variablesRKE2_KUBE_PROXY_EXTRA_ENV
etcd-extra-envetcd extra environment variablesRKE2_ETCD_EXTRA_ENV
cloud-controller-manager-extra-envcloud-controller-manager extra environment variablesRKE2_CLOUD_CONTROLLER_MANAGER_EXTRA_ENV

Image

FlagDescriptionEnviroment Variable
kube-apiserver-imageOverride image to use for kube-apiserverRKE2_KUBE_APISERVER_IMAGE
kube-controller-manager-imageOverride image to use for kube-controller-managerRKE2_KUBE_CONTROLLER_MANAGER_IMAGE
cloud-controller-manager-imageOverride image to use for cloud-controller-managerRKE2_CLOUD_CONTROLLER_MANAGER_IMAGE
kube-proxy-imageOverride image to use for kube-proxyRKE2_KUBE_PROXY_IMAGE
kube-scheduler-imageOverride image to use for kube-schedulerRKE2_KUBE_SCHEDULER_IMAGE
pause-imageOverride image to use for pauseRKE2_PAUSE_IMAGE
runtime-imageOverride image to use for runtime binaries (containerd, kubectl, crictl, etc)RKE2_RUNTIME_IMAGE
etcd-imageOverride image to use for etcdRKE2_ETCD_IMAGE

Cloud Provider

FlagDescriptionEnviroment Variable
cloud-provider-nameCloud provider nameRKE2_CLOUD_PROVIDER_NAME
cloud-provider-configCloud provider configuration file pathRKE2_CLOUD_PROVIDER_CONFIG

Security

FlagDescriptionEnviroment Variable
profileValidate system configuration against the selected benchmark (valid items: cis, cis-1.23 (deprecated))RKE2_CIS_PROFILE
audit-policy-filePath to the file that defines the audit policy configurationRKE2_AUDIT_POLICY_FILE
pod-security-admission-config-filePath to the file that defines Pod Security Admission configurationRKE2_POD_SECURITY_ADMISSION_CONFIG_FILE

Experimental

FlagDescriptionEnviroment Variable
kubelet-pathOverride kubelet binary pathRKE2_KUBELET_PATH