Enable node autonomy

更新时间:
复制 MD 格式

Hybrid cloud and edge nodes support node autonomy to keep applications running stably during cloud-edge disconnections without pod eviction or rescheduling to other nodes. Without node autonomy, applications are evicted after the toleration period expires when the network disconnects. This topic describes how to enable node autonomy.

Node autonomy

In hybrid cloud and edge scenarios, the network between nodes and the cloud control plane can be unstable or intermittent. In standard Kubernetes, if a node stops reporting heartbeats, its status becomes NotReady and pods are evicted after the toleration period expires.

Node autonomy prevents pod eviction when a node becomes NotReady during cloud-edge network disconnections or jitter, keeping services running on the node. Typical scenarios include:

  • Workloads that must run locally despite frequent network disconnections.

  • Environments where leased-line bandwidth limits or traffic spikes make the control plane unreachable.

  • Applications that require high availability and cannot tolerate rescheduling.

Applicability

Node autonomy applies to hybrid cloud node pools and edge node pools.

Enable node autonomy

  1. Install the yurt-hub-controlplane component. Skip if already installed.

    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 Components and Add-ons.

    3. Install yurt-hub-controlplane. No configuration needed.

  2. Install the yurt-hub node component on the node pool, either when creating a new pool or for an existing one.

    New node pool

    1. When you create a node pool, select yurt-hub in the Node Add-on Management section.

    2. Click Configuration next to yurt-hub and select Enable Node Autonomy.

    3. (Optional) Configure cacheAgents to cache Kubernetes resource data during cloud-edge disconnections. See Configure the cache component.

    4. Create the node pool. Node autonomy is automatically enabled on its nodes.

    New nodes added to this node pool get yurt-hub installed automatically.

    Existing node pool

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

    2. Click the node pool ID, then click the Node Add-on Management tab.

    3. Click Install Node Components. In the list, select yurt-hub and click Next.

    4. In the Parameter Configurations section, select Enable Node Autonomy.

    5. (Optional) Configure cacheAgents to cache Kubernetes resource data during cloud-edge disconnections. See Configure the cache component.

    6. Configure the batch update policy and complete the installation. Nodes are updated in batches per the policy.

  3. Obtain the KubeConfig of the cluster and use kubectl to connect to the cluster.

  4. Verify yurt-hub is running:

    kubectl get pods -n kube-system -l app=yurt-hub

    If the yurt-hub pods are in Running state, the component works correctly.

  5. Simulate a cloud-edge disconnection, for example, by disconnecting the node from the API server. With node autonomy enabled, pods should remain Running and not be evicted.

    By default, yurt-hub extends the node's heartbeat timeout toleration. The duration depends on cluster configuration. After reconnection, the node automatically syncs its status with the control plane.

Configure the cache component

yurt-hub caches API server resource data, such as pod and ConfigMap details, to the node disk at /etc/kubernetes/cache. Business data is not cached. This keeps applications running during cloud-edge disconnections. To configure caching:

  1. Obtain the User-Agent of your application, typically the startup command of the container. For community components, check 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=2
  2. Add the User-Agent to cacheAgents, then save the configuration and update the nodes.

    After configuration, yurt-hub caches all data between the specified component and the API server to the node's disk.
  3. Log on to the node and check /etc/kubernetes/cache. If a directory matching the User-Agent name exists, caching is configured correctly.

Ensure service availability for autonomous pods

With node autonomy enabled, pods are not evicted during cloud-edge disconnections. To also keep these pods as valid Service Endpoints during a disconnection, configure a Kube Controller Manager feature gate:

  • On the ACK Clusters page, click the name of your cluster. In the left navigation pane, click Add-ons.

  • Select Kube Controller Manager and click Settings. In featureGates, enter NodeAutonomyPodProtection=true and click OK.