add_nodes.yaml is used to add new nodes to an existing Kubernetes cluster, supporting the addition of etcd nodes, worker nodes, or control plane nodes.
-
Global Initialization
- Execute the
native/rootrole on all nodes.
- Execute the
-
Pre Install Hook
- Import and execute pre-installation scripts from
hook/pre_install.yaml.
- Import and execute pre-installation scripts from
-
Load Defaults and Precheck
- Load default configurations (
defaults) on all nodes. - Execute the
precheckrole to verify that new nodes meet the conditions for joining the cluster.
- Load default configurations (
-
Resource Preparation
- Execute
certs/initonlocalhostto generate or update certificates. - Execute
downloadonlocalhostto download required software packages and images.
- Execute
-
Node Initialization
- Execute the
nativerole for all nodes in theetcd,k8s_cluster,image_registry, andnfsgroups to install base packages and configure the system environment.
- Execute the
-
etcd Expansion (external mode only)
- For nodes in the
etcdgroup, execute in sequence:etcd/prepareetcd/backupetcd/scaling_up/learneretcd/installetcd/scaling_up/promoteetcd/postprocess
- The above steps are triggered only when
etcd.deployment_typeisexternaland the node is in theneed_installed_etcdlist.
- For nodes in the
-
Sync etcd Config
- Execute
kubernetes/sync-etcd-configonkube_control_planenodes to sync etcd configuration to the control plane.
- Execute
-
Container Runtime and Kubernetes Installation
- For nodes in the
k8s_clustergroup, execute:cri: Install the container runtime.kubernetes/pre-kubernetes: Install pre-requisites.kubernetes/init-kubernetes: Initialize Kubernetes.kubernetes/join-kubernetes: Join the new node to the cluster (triggered only when the node has not yet loaded Kubernetes services).kubernetes/certs: Distribute or renew certificates (triggered only on control plane nodes when certificate renewal is enabled).
- The above roles are filtered using the
add_nodeslist, affecting only nodes that need to be added.
- For nodes in the