|
This is unreleased documentation for SUSE® Rancher Manager v2.16 (Unreleased). |
SUSE Rancher Prime Agents
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
The 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.
rancher-system-agent
The rancher-system-agent is a daemon used to manage nodes in a Rancher provisioned RKE2/K3s Kubernetes cluster when performing cluster lifecycle operations. Examples of cluster operations include upgrading the Kubernetes version and creating/restoring etcd snapshots. The rancher-system-agent is designed to apply plans to the Rancher system and can support both local and remote plans.
Requests
The cattle-cluster-agent pod does not define the default CPU and memory request values. As a baseline, we recommend setting the CPU request at 50m and memory request at 100Mi. However, it is important that you assess your use case appropriately and that you allocate the correct resources to your cluster for your needs.
To configure request values through the UI for RKE2/K3s clusters:
-
When you create or edit an existing cluster, go to the Cluster Configuration.
-
Select the Cluster Agent subsection.
-
Configure your request values using the CPU Reservation and Memory Reservation fields as needed.
If you prefer to configure via YAML, add the following snippet to your RKE2/K3s configuration file:
spec:
clusterAgentDeploymentCustomization:
overrideResourceRequirements:
requests:
cpu: 50m
memory: 100Mi
Reconnection backoff
The cattle-cluster-agent holds a WebSocket tunnel to the Rancher server and reconnects whenever that tunnel drops. By default it retries every 10 seconds for as long as the cluster is disconnected. On clusters with unreliable or high-latency uplinks, such as edge deployments, a long outage can produce hundreds of failed connection attempts.
Two optional environment variables control the retry timing:
| Variable | Default | Description |
|---|---|---|
|
|
Delay after the first failed attempt. |
|
none |
Upper limit for the delay. When set, the delay doubles after each consecutive failure until it reaches this value. |
Both accept a Go duration string, such as 30s, 5m, or 1h30m. A value without a unit, such as 30, is invalid and the default is used instead. Each delay is randomized by plus or minus 10% so that agents across a fleet do not all reconnect at the same moment.
If you set only CATTLE_CONNECT_RETRY_MIN, the agent retries at that fixed interval. If you set both, the delay grows between them. For example, CATTLE_CONNECT_RETRY_MIN=5s with CATTLE_CONNECT_RETRY_MAX=5m produces delays of 5s, 10s, 20s, 40s, and so on, up to a maximum of 5 minutes.
Set these per cluster using Agent Environment Vars:
spec:
agentEnvVars:
- name: CATTLE_CONNECT_RETRY_MIN
value: 5s
- name: CATTLE_CONNECT_RETRY_MAX
value: 5m
Scheduling Rules
The cattle-cluster-agent uses either a fixed set of tolerations, or dynamically-added tolerations based on taints applied to the control plane nodes. This structure allows Taint based Evictions to work properly for cattle-cluster-agent.
If control plane nodes are present in the cluster, the default tolerations will be replaced with tolerations matching the taints on the control plane nodes. The default set of tolerations are described below.
| Component | nodeAffinity nodeSelectorTerms | nodeSelector | Tolerations |
|---|---|---|---|
|
|
none |
Note: These are the default tolerations, and will be replaced by tolerations matching taints applied to controlplane nodes. |
The 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.
The preferredDuringSchedulingIgnoredDuringExecution configuration is shown in the table below:
| Weight | Expression |
|---|---|
100 |
|
100 |
|
100 |
|
1 |
|