Skip to main content

Server Configuration Reference

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

Critical Configuration Values​

The following options must be set to the same value on all servers in the cluster. Failure to do so will cause new servers to fail to join the cluster.

  • agent-token
  • cluster-cidr
  • cluster-dns
  • cluster-domain
  • disable-cloud-controller
  • disable-kube-proxy
  • egress-selector-mode
  • service-cidr

Common​

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

Listener​

FlagDescriptionDefault
bind-addressrke2 bind address0.0.0.0
advertise-addressIPv4/IPv6 address that apiserver uses to advertise to members of the clusternode-external-ip/node-ip
tls-sanAdd additional hostnames or IPv4/IPv6 addresses as Subject Alternative Names on the server TLS cert
tls-san-securityProtect the server TLS cert by refusing to add Subject Alternative Names not associated with the kubernetes apiserver service, server nodes, or values of the tls-san optiontrue

Networking​

FlagDescriptionDefaultEnvironment Variable
cluster-cidrIPv4/IPv6 network CIDRs to use for pod IPs10.42.0.0/16
service-cidrIPv4/IPv6 network CIDRs to use for service IPs10.43.0.0/16
service-node-port-rangePort range to reserve for services with NodePort visibility"30000-32767"
cluster-dnsIPv4/IPv6 Cluster IP for coredns service. Should be in your service-cidr range10.43.0.10
cluster-domainCluster Domain"cluster.local"
egress-selector-modeOne of 'agent', 'cluster', 'pod', 'disabled'"agent"
servicelb-namespaceNamespace of the pods for the servicelb component"kube-system"
cniCNI Plugins to deploy, one of none, calico, canal, cilium, flannel; optionally with multus as the first value to enable the multus meta-plugin"canal"RKE2_CNI
ingress-controllerIngress Controllers to deploy, one of none, traefik, ingress-nginx; the first value will be set as the default ingress classRKE2_INGRESS_CONTROLLER

Client​

FlagDescriptionEnvironment Variable
write-kubeconfigWrite kubeconfig for admin client to this fileRKE2_KUBECONFIG_OUTPUT
write-kubeconfig-modeWrite kubeconfig with this modeRKE2_KUBECONFIG_MODE
write-kubeconfig-groupWrite kubeconfig with this groupRKE2_KUBECONFIG_GROUP

Helm​

FlagDescription
helm-controller-argCustomized flag for helm-controller process

Cluster​

FlagDescriptionEnvironment Variable
tokenShared secret used to join a server or agent to a clusterRKE2_TOKEN
token-fileFile containing the tokenRKE2_TOKEN_FILE
agent-tokenShared secret used to join agents to the cluster, but not serversRKE2_AGENT_TOKEN
agent-token-fileFile containing the agent secretRKE2_AGENT_TOKEN_FILE
serverServer to connect to, used to join a clusterRKE2_URL
cluster-resetForget all peers and become sole member of a new clusterRKE2_CLUSTER_RESET

Database​

FlagDescriptionDefaultEnvironment Variable
cluster-reset-restore-pathPath to snapshot file to be restored
datastore-endpointSpecify etcd, NATS, MySQL, Postgres, or SQLite data source namesqliteRKE2_DATASTORE_ENDPOINT
datastore-cafileTLS Certificate Authority file used to secure datastore backend communicationRKE2_DATASTORE_CAFILE
datastore-certfileTLS certification file used to secure datastore backend communicationRKE2_DATASTORE_CERTFILE
datastore-keyfileTLS key file used to secure datastore backend communicationRKE2_DATASTORE_KEYFILE
etcd-expose-metricsExpose etcd metrics to client interfacefalse
etcd-disable-snapshotsDisable automatic etcd snapshotsfalse
etcd-snapshot-nameSet the base name of etcd snapshots, appended with UNIX timestamp"etcd-snapshot"
etcd-snapshot-schedule-cronSnapshot interval time in cron spec. eg. every 5 hours '0 */5 * * *'"0 */12 * * *"
etcd-snapshot-reconcile-intervalSnapshot reconcile interval10m0s
etcd-snapshot-retentionNumber of local snapshots to retain on each server node5
etcd-snapshot-dirDirectory to save db snapshots.${data-dir}/server/db/snapshots
etcd-snapshot-compressCompress etcd snapshotfalse

S3 etcd Snapshot Storage​

FlagDescriptionDefaultEnvironment Variable
etcd-s3Enable backup to S3false
etcd-s3-endpointS3 endpoint url"s3.amazonaws.com"
etcd-s3-endpoint-caS3 custom CA cert to connect to S3 endpoint
etcd-s3-skip-ssl-verifyDisables S3 SSL certificate validationfalse
etcd-s3-access-keyS3 access keyAWS_ACCESS_KEY_ID
etcd-s3-secret-keyS3 secret keyAWS_SECRET_ACCESS_KEY
etcd-s3-session-tokenS3 session tokenAWS_SESSION_TOKEN
etcd-s3-bucketS3 bucket name
etcd-s3-bucket-lookup-typeS3 bucket lookup type, one of 'auto', 'dns', 'path'; default is 'auto' if not set
etcd-s3-regionS3 region / bucket location (optional)"us-east-1"
etcd-s3-folderS3 folder
etcd-s3-retentionNumber of S3 snapshots to retain in the configured region, bucket, and prefix5
etcd-s3-proxyProxy server to use when connecting to S3, overriding any proxy-releated environment variables
etcd-s3-config-secretName of secret in the kube-system namespace used to configure S3, if etcd-s3 is enabled and no other etcd-s3 options are set
etcd-s3-insecureDisables S3 over HTTPSfalse
etcd-s3-timeoutS3 timeout5m0s

Flags​

FlagDescription
kube-apiserver-argCustomized flag for kube-apiserver process
etcd-argCustomized flag for etcd process
kube-controller-manager-argCustomized flag for kube-controller-manager process
kube-scheduler-argCustomized flag for kube-scheduler process
kube-cloud-controller-manager-argCustomized flag for kube-cloud-controller-manager process

Components​

FlagDescriptionDefaultEnvironment Variable
disableDo not deploy packaged components and delete any deployed components (valid items: rke2-coredns, rke2-metrics-server, rke2-snapshot-controller, rke2-snapshot-controller-crd, rke2-snapshot-validation-webhook, rke2-security-responder, rke2-gateway-api-crd)
disable-schedulerDisable Kubernetes default schedulerfalse
disable-cloud-controllerDisable rke2 default cloud controller managerfalse
disable-kube-proxyDisable running kube-proxyfalse
embedded-registryEnable embedded distributed container registry; requires use of embedded containerd; when enabled agents will also listen on the supervisor portfalse
enable-servicelbEnable rke2 default cloud controller manager's service controllerfalseRKE2_ENABLE_SERVICELB
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​

FlagDescriptionEnvironment 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​

FlagDescriptionDefaultEnvironment Variable
cloud-provider-nameCloud provider nameRKE2_CLOUD_PROVIDER_NAME
cloud-provider-configCloud provider configuration file pathRKE2_CLOUD_PROVIDER_CONFIG
node-name-from-cloud-provider-metadataSet node name from instance metadata service hostnamefalseRKE2_NODE_NAME_FROM_CLOUD_PROVIDER_METADATA

Security​

FlagDescriptionEnvironment Variable
profileValidate system configuration against the selected benchmark (valid items: cis, etcd)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​

FlagDescriptionDefaultEnvironment Variable
supervisor-metricsEnable serving rke2 internal metrics on the supervisor port; when enabled agents will also listen on the supervisor portfalse
enable-pprofEnable pprof endpoint on supervisor portfalse
secrets-encryption-providerSecret encryption provider (valid values: 'aescbc', 'secretbox')"aescbc"
kubelet-pathOverride kubelet binary pathRKE2_KUBELET_PATH

Agent/Node​

FlagDescriptionDefaultEnvironment Variable
node-nameNode nameRKE2_NODE_NAME
with-node-idAppend id to node namefalse
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"
protect-kernel-defaultsKernel tuning behavior. If set, error if kernel tunables are different than kubelet defaults.false
selinuxEnable SELinux in containerdfalseRKE2_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

Agent/Runtime​

FlagDescriptionDefaultEnvironment Variable
container-runtime-endpointDisable embedded containerd and use the CRI socket at the given path
default-runtimeSet the default runtime in containerd
snapshotterOverride default containerd snapshotter"overlayfs"
private-registryPrivate registry configuration file"/etc/rancher/rke2/registries.yaml"
system-default-registryPrivate registry to be used for all system imagesRKE2_SYSTEM_DEFAULT_REGISTRY

Agent/Containerd​

FlagDescriptionDefault
disable-default-registry-endpointDisables containerd's fallback default registry endpoint when a mirror is configured for that registryfalse
nonroot-devicesAllows non-root pods to access devices by setting device_ownership_from_security_context=true in the containerd CRI configfalse

Agent/Networking​

FlagDescriptionEnvironment Variable
node-ipIPv4/IPv6 addresses to advertise for node
node-external-ipIPv4/IPv6 external IP addresses to advertise for node
node-internal-dnsinternal DNS addresses to advertise for node
node-external-dnsexternal DNS addresses to advertise for node
resolv-confKubelet resolv.conf fileRKE2_RESOLV_CONF

Agent/Flags​

FlagDescription
kubelet-argCustomized flag for kubelet process
kube-proxy-argCustomized flag for kube-proxy process