There are two different agent resources deployed on Rancher managed clusters:
For a conceptual overview of how the Rancher server provisions clusters and communicates with them, refer to the architecture.
cattle-cluster-agent is used to connect to the Kubernetes API of Rancher Launched Kubernetes clusters. The
cattle-cluster-agent is deployed using a Deployment resource. It will always prefer control plane nodes over workers.
cattle-node-agent is used to interact with nodes in a Rancher Launched Kubernetes cluster when performing cluster operations. Examples of cluster operations are upgrading Kubernetes version and creating/restoring etcd snapshots. The
cattle-node-agent is used as fallback option to connect to the Kubernetes API of Rancher Launched Kubernetes clusters when
cattle-cluster-agent is unavailable. The
cattle-node-agent is deployed using a DaemonSet resource to make sure it runs on every node.
cattle-cluster-agent uses a fixed set of tolerations (listed below, if no controlplane nodes are visible in the cluster) or dynamically added tolerations based on taints applied to the controlplane nodes such that if controlplane nodes are present in the cluster, the cluster agent's tolerations will be replaced with tolerations matching the taints on the controlplane nodes. This structure allows for Taint based Evictions to work properly for
cattle-cluster-agent. The default tolerations are described below:
|none||Note: These are the default tolerations, and will be replaced by tolerations matching taints applied to controlplane nodes.|
cattle-cluster-agent Deployment has preferred scheduling rules using
preferredDuringSchedulingIgnoredDuringExecution, favoring to be scheduled on nodes with the
controlplane node. When there are no controlplane nodes visible in the cluster (this is usually the case when using Clusters from Hosted Kubernetes Providers), you can add the label
cattle.io/cluster-agent=true on a node to prefer scheduling the
cattle-cluster-agent pod to that node.
See Kubernetes: Assigning Pods to Nodes to find more information about scheduling rules.
preferredDuringSchedulingIgnoredDuringExecution configuration is shown in the table below: