# K3s 集群主机清单 --- all: vars: # SSH 配置 (初始连接使用密码) ansible_user: root ansible_port: 2103 ansible_password: "{{ lookup('env', 'SSH_PASSWORD') }}" # SSH 安全配置 ssh_new_port: 2103 ssh_pubkey: "{{ lookup('env', 'SSH_PUBKEY') | default(lookup('file', '~/.ssh/id_rsa.pub'), true) }}" children: # Master 节点 (Server) masters: hosts: tca: ansible_host: tca.node.dev.cm node_hostname: tca cluster_init: true node_region: cn-sh use_mirror: true tcb: ansible_host: tcb.node.dev.cm node_hostname: tcb node_region: cn-sh use_mirror: true tcc: ansible_host: tcc.node.dev.cm node_hostname: tcc node_region: cn-sh use_mirror: true # Agent 节点 (Worker) agents: hosts: tce: ansible_host: tce.node.dev.cm node_hostname: tce node_region: cn-sh use_mirror: true tcd: ansible_host: tcd.node.dev.cm node_hostname: tcd node_region: cn-sh use_mirror: true tchk: ansible_host: tchk.node.dev.cm node_hostname: tchk node_region: cn-hk enable_lb: true tthk: ansible_host: tthk.node.dev.cm node_hostname: tthk node_region: cn-hk enable_lb: true alihk: ansible_host: alihk.node.dev.cm node_hostname: alihk node_region: cn-hk enable_lb: true netfilter_mode: nodivert alihka: ansible_host: alihka.node.dev.cm node_hostname: alihka node_region: cn-hk netfilter_mode: nodivert hwhk: ansible_host: hwhk.node.dev.cm node_hostname: hwhk node_region: cn-hk enable_lb: true netfilter_mode: nodivert hwsg: ansible_host: hwsg.node.dev.cm node_hostname: hwsg node_region: sg-sg netfilter_mode: nodivert hwa: ansible_host: hwa.node.dev.cm node_hostname: hwa node_region: cn-sh use_mirror: true netfilter_mode: nodivert clawhk: ansible_host: clawhk.node.dev.cm node_hostname: clawhk node_region: cn-hk clawjp: ansible_host: clawjp.node.dev.cm node_hostname: clawjp node_region: jp-tyo # 节点分组 k3s_cluster: children: masters: agents: