文件
k3s/ansible/inventory/hosts.yml
T

55 行
1.3 KiB
YAML

# 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:
alihk:
ansible_host: alihk.node.dev.cm
node_hostname: alihk
node_region: cn-hk
enable_lb: true
netfilter_mode: nodivert
clawhk:
ansible_host: clawhk.node.dev.cm
node_hostname: clawhk
node_region: cn-hk
# 节点分组
k3s_cluster:
children:
masters:
agents: