Configure edge node autonomy

Updated at:
Copy as MD

ACK Edge clusters support edge node autonomy. This feature ensures that applications on an edge node continue to run without interruption during a cloud-edge network disconnection and are not evicted or migrated. If an edge node is not autonomous, its applications will be evicted after a toleration period expires. This topic describes how to configure the autonomy settings for your edge nodes.

Prerequisites

Background information

Edge node autonomy can be enabled or disabled. By default, edge nodes are not autonomous when they are added to a cluster.

  • When edge node autonomy is enabled, applications on the node are not evicted and automatically recover if the node disconnects from the control plane. This configuration is ideal for edge computing scenarios with unstable network connectivity.

  • When edge node autonomy is disabled, a node that disconnects from the control plane stops reporting heartbeats. Its status is set to Unavailable, and Pods on the node are evicted after their toleration period expires.

Enable node autonomy

Console

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Nodes > Nodes.

  3. On the Nodes page, find the target node and choose More > Node Autonomy Setting in the Actions column.

    Note

    The Node Autonomy Setting button appears only for edge nodes.

  4. In the Node Autonomy Setting dialog box, click OK.

Kubectl

Add the following annotation to an edge node to enable node autonomy. This setting applies only to edge nodes.

kubectl annotate node <node-name> node.beta.openyurt.io/autonomy=true --overwrite

You can also configure an autonomy duration for the edge node.

Note

You can configure an autonomy duration only for ACK Edge clusters that run Kubernetes 1.28 or later. After this setting is configured, Pods on the node are not evicted if a cloud-edge network disconnection lasts for less than the specified autonomy duration. If the disconnection exceeds this duration, the Pods are evicted.

kubectl annotate node <node-name> node.alibabacloud.com/autonomy-duration=500s --overwrite

Verify node autonomy status

  1. On the Clusters page, click the name of your cluster. In the left navigation pane, click Nodes > Nodes.

  2. On the Nodes page, find the target node and choose More > Details in the Actions column.

  3. On the Basic Information tab, find the Status section. If the status for Autonomy is True, node autonomy is enabled.

Configure cache component

EdgeHub caches data that node components require from the API Server to ensure they run properly during a cloud-edge network disconnection. The disk cache directory is /etc/kubernetes/cache.

Note

Cached data refers to resource information exchanged with the API Server, such as Pod and ConfigMap resources. It does not include business data.

If you have components that require data from the API Server to run properly during a disconnection, perform the following steps:

  1. Obtain the User-Agent string for your component. For community components, you can find this information in the component's documentation or community forums.

  2. Log on to the ACK console. In the left navigation pane, click Clusters.

  3. On the Clusters page, click the name of your cluster. In the left navigation pane, click Configurations > ConfigMaps.

  4. Switch the Namespace to kube-system, find the ConfigMap where the Name is edge-hub-cfg, and click Edit YAML on the right.

  5. Add your User-Agent to the cache_agents key and click OK.

  6. Log on to the node and go to the /etc/kubernetes/cache directory to verify that a directory named after your User-Agent exists.

After this configuration is complete, data exchanged between the component and the API Server is persisted to the node's disk. If node autonomy is enabled, the component can then retrieve this data from the local disk to run properly during a disconnection.