# K3s Ansible 全局变量 --- # ============================================ # 敏感信息 (通过环境变量传入) # ============================================ tailscale_auth_key: "{{ lookup('env', 'TAILSCALE_AUTH_KEY') }}" # 高可用集群的 server_url 需要指向负载均衡器地址,单节点集群则指向自身 ha_server_url: "{{ lookup('env', 'HA_SERVER_URL') | default('', true) }}" # ============================================ # K3s 配置 # ============================================ # K3s Server URL (优先使用 HA_SERVER_URL,否则动态使用 init 节点地址) k3s_server_url: "{{ ha_server_url if (ha_server_url | length > 0) else '' }}" k3s_version: "v1.34.2+k3s1" tailscale_version: "1.96.4" # ETCD 配置 etcd_snapshot_retention: 1 etcd_snapshot_schedule_cron: "0 0 * * *" etcd_snapshot_compress: true # 禁用的组件 k3s_disable_components: - traefik # ============================================ # 安装源配置 # ============================================ # 国内镜像源 mirror_k3s_install_url: "https://rancher-mirror.rancher.cn/k3s/k3s-install.sh" # 官方源 global_k3s_install_url: "https://get.k3s.io" # ============================================ # 镜像加速配置 (use_mirror: true 时启用) # ============================================ registry_mirrors: docker.io: - "docker.1ms.run" - "docker.m.daocloud.io" ghcr.io: - "ghcr.m.daocloud.io" registry.k8s.io: - "k8s.m.daocloud.io" quay.io: - "quay.m.daocloud.io"