131 行
3.6 KiB
YAML
131 行
3.6 KiB
YAML
# K3s 集群主机清单
|
|
---
|
|
all:
|
|
vars:
|
|
# SSH 配置
|
|
ansible_user: root
|
|
# 默认端口,首次安装时使用22,后续会被动态覆盖
|
|
ansible_port: 22
|
|
ansible_password: "{{ lookup('env', 'SSH_PASSWORD') | default(omit, true) }}"
|
|
|
|
# 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
|
|
node_taints:
|
|
- "node-role.kubernetes.io/control-plane:NoSchedule"
|
|
tcb:
|
|
ansible_host: tcb.node.dev.cm
|
|
node_hostname: tcb
|
|
node_region: cn-sh
|
|
use_mirror: true
|
|
node_taints:
|
|
- "node-role.kubernetes.io/control-plane:NoSchedule"
|
|
tcc:
|
|
ansible_host: tcc.node.dev.cm
|
|
node_hostname: tcc
|
|
node_region: cn-sh
|
|
use_mirror: true
|
|
node_taints:
|
|
- "node-role.kubernetes.io/control-plane:NoSchedule"
|
|
|
|
# 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
|
|
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
|
|
enable_lb: true
|
|
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
|
|
orajpa:
|
|
ansible_host: orajpa.node.dev.cm
|
|
node_hostname: orajpa
|
|
node_region: jp-tyo
|
|
orakra:
|
|
ansible_host: orakra.node.dev.cm
|
|
node_hostname: orakra
|
|
node_region: kr-sel
|
|
orasga:
|
|
ansible_host: orasga.node.dev.cm
|
|
node_hostname: orasga
|
|
node_region: sg-sg
|
|
# 以下为内网节点 需要手动先配置好vpn才能访问
|
|
homea:
|
|
ansible_host: homea
|
|
node_hostname: homea
|
|
node_region: cn-sh
|
|
use_mirror: true
|
|
homeb:
|
|
ansible_host: homeb
|
|
node_hostname: homeb
|
|
node_region: cn-sh
|
|
use_mirror: true
|
|
|
|
# 节点分组
|
|
k3s_cluster:
|
|
children:
|
|
masters:
|
|
agents:
|
|
|