Hybrid cloud nodes and edge nodes support the node autonomy feature. When a node disconnects from the cloud control plane, this feature ensures its applications continue to run stably without being evicted or migrated. If node autonomy is not enabled, applications on a disconnected node are evicted after a specified toleration period expires. This topic describes how to enable the node autonomy feature.
Node autonomy
In hybrid cloud and edge computing scenarios, the network connection between a node and the cloud control plane can be unstable, bandwidth-constrained, or intermittent. In a standard Kubernetes environment, if a node cannot continuously report heartbeats to the control plane, its status is marked as NotReady. This triggers pod eviction after the pod's toleration period expires, leading to unnecessary service disruptions.
The node autonomy feature optimizes hybrid cloud node pools and edge node pools for these scenarios. It prevents pods from being evicted even if a node's status becomes NotReady during a cloud-edge network disconnection or network jitter. This ensures stable service operation on the node. This feature is designed for scenarios where the cloud-edge network link is unreliable, including:
Workloads that must operate locally despite frequent, brief network disconnections.
Environments where the control plane becomes unreachable due to leased-line bandwidth constraints or sudden traffic spikes.
Applications that demand high business continuity and cannot tolerate frequent rescheduling.
Applicability
The node autonomy feature applies to hybrid cloud node pools and edge node pools.
Enable node autonomy
Install the yurt-hub-controlplane component on your cluster. If it is already installed, skip this step.
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click Components and Add-ons.
Install yurt-hub-controlplane. No configuration is required.
Install the yurt-hub node component on the node pool. You can do this when you create a new node pool or for an existing one.
New node pool
When you create a node pool, select yurt-hub in the Node Add-on Management section.
Click Configuration to the right of yurt-hub. In the dialog box that appears, select Enable Node Autonomy.
(Optional) To cache Kubernetes resource information during a cloud-edge network disconnection, configure cacheAgents as needed to enable data caching. For more information, see Configure the cache component.
Create the node pool. The node autonomy feature is automatically enabled on the nodes in this node pool.
When you add new nodes to this node pool, the yurt-hub node component is installed automatically.
Existing node pool
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
Click the ID of the target node pool. On the node pool details page, click the Node Add-on Management tab.
Click Install Node Components. In the list, select yurt-hub and click Next.
In the Parameter Configurations section, select Enable Node Autonomy.
(Optional) To cache Kubernetes resource information during a cloud-edge network disconnection, configure cacheAgents as needed to enable data caching. For more information, see Configure the cache component.
Configure the batch update policy as needed and complete the component installation. The nodes are automatically updated in batches based on the configured policy.
Obtain the KubeConfig of the cluster and use kubectl to connect to the cluster.
Verify that the yurt-hub component is running properly:
kubectl get pods -n kube-system -l app=yurt-hubIf the yurt-hub pods are in the Running state, the component is working as expected.
Simulate a cloud-edge network disconnection, for example, by disconnecting the node from the cloud API server, and observe whether the pods on the node are evicted. With node autonomy enabled, the pods should remain in the Running state during the disconnection.
By default, the yurt-hub component extends the node's heartbeat timeout toleration period. The exact duration depends on the cluster configuration. After the connection is restored, the node automatically synchronizes its status with the control plane.
Configure the cache component
The yurt-hub component caches data from the API server for applications on the node. This data includes resource information, such as pod and ConfigMap details, but does not include business data. This caching ensures that applications can continue to function when the node pool is disconnected from the cloud control plane. The disk cache directory is /etc/kubernetes/cache. To run your applications from the cache during a network disconnection, follow these steps to configure it:
Obtain the User-Agent of your application. This is typically the startup command of the business container. For community components, you can find this information in the relevant community resources.
apiVersion: v1 kind: Pod metadata: name: hybrid-app-pod spec: containers: - name: "hybrid-app" image: "xxx/hybrid-app-amd64:1.18.8" command: - /bin/sh - -ec - | # The User-Agent is the startup command: hybrid-app /usr/local/bin/hybrid-app --v=2Add the User-Agent to the cacheAgents configuration parameter. Then, save the component configuration and update the nodes.
After you complete the configuration, yurt-hub caches all data exchanged between the specified component and the API server to the node's disk.
Log on to the node and navigate to the
/etc/kubernetes/cachedirectory. If a directory with the same name as the User-Agent exists, the cache is configured successfully.
Ensure service availability for autonomous pods
After you enable node autonomy, pods on a node pool are not evicted when the node pool disconnects from the cloud control plane. To further ensure that these pods remain available within the node pool during a disconnection, you can configure a feature gate of the Kube Controller Manager component. This ensures that the pods remain valid Endpoints for their corresponding Services:
On the ACK Clusters page, click the name of your cluster. In the left navigation pane, click Add-ons.
Select the Kube Controller Manager component and click Settings. In the featureGates field, enter
NodeAutonomyPodProtection=trueand click OK.