Skip to content

Commit

Permalink
Merge pull request #7 from paradeum-team/jyliu
Browse files Browse the repository at this point in the history
fix: 修复单机安装缺少变量异常问题
  • Loading branch information
ss75710541 authored Dec 14, 2021
2 parents e84a41f + b16c5c1 commit 075c821
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
23 changes: 13 additions & 10 deletions ansible.hosts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ new_nodes
[k8sCluster:vars]
# SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=root
#ansible_ssh_pass=xxxxxx
ansible_port=22

# If ansible_ssh_user is not root, ansible_become must be set to true
Expand All @@ -16,26 +17,26 @@ ansible_become=false
# 是否更新操作系统及内核
is_system_update=True

# 默认节点不是公网节点
public_network_node = True
# 默认节点是否公网节点
public_network_node = False

# 是否开启 flannel
flannel_enable=True

# api server 域名
master_vip="172.26.117.104"
master_vip_advertise_address="8.142.71.35"
# api server 域名, 单master 写master ip, 多master 写vip
master_vip="172.16.195.211"
master_vip_advertise_address="x.x.x.x"
node_domain=solarfs.k8s
install_domain=install.{{node_domain}}
api_server_domain="api-server.{{node_domain}}"
api_server_port="6443"

# k8s 版本
k8s_version=1.21.4
k8s_version=1.22.2
# 定义外部镜像仓库
registry_domain=registry.hisun.netwarps.com
registry_repo="{{registry_domain}}"
kubeadm_registry_repo="registry.cn-hangzhou.aliyuncs.com"
kubeadm_registry_repo="{{registry_domain}}"
coredns_image_repo="docker.io/coredns"
coredns_image_tag="1.8.0"
flannel_image_repo="quay.io"
Expand All @@ -50,12 +51,14 @@ helm_binary_md5=24b16800f8c7f44b5dd128e3355ecf1b
helm_binary_url=https://pnode.solarfs.io/dn/file/{{helm_binary_md5}}/helm-v3.6.3-linux-amd64.tar.gz

[install]
master1.solarfs.k8s
master1.kuggatest.k8s

[masters]
master1.solarfs.k8s ansible_host=172.26.117.104 advertise_address="8.142.71.35"
master1.kuggatest.k8s ansible_host=172.16.195.211

[nodes]
node1.solarfs.k8s ansible_host=8.142.71.142 advertise_address="8.142.71.142"
infra1.kuggatest.k8s ansible_host=172.16.3.85
node1.kuggatest.k8s ansible_host=172.16.128.250
node2.kuggatest.k8s ansible_host=172.16.214.182

[new_nodes]
9 changes: 1 addition & 8 deletions config.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LOCAL_ENNAME=eth0 ## Need to check
is_offline=False

# 主机环境实际使用的上游dns server,酌情修改,公司内部实际使用的dns服务ip地址,poc建议为空(公司测试环境不建议配置,因为配置后所有节点就都可以访问外网,>有可能影响线>下包测试的准确性)
upstream_dns_ips="172.26.164.91"
upstream_dns_ips="10.8.255.1 10.8.255.2 114.114.114.114"

# 是否安装时间同步服务(chronyd),True表示安装,False表示不安装,默认True,只有已经安装了 ntp 时间同步服务的情况下不安装;
chronyd_install="True"
Expand All @@ -27,10 +27,3 @@ fi
export CONFIGSERVER_IP="$LOCAL_IP"
export CONFIGSERVER_PORT="8081"


# 高可用部署开关,True为部署高可用版,False为单机版一般无需改动
if [ `$BASE_DIR/read-ansible-hosts.py -k masters|wc -l` -gt 1 ] ;then
HA="True"
else
HA="False"
fi
2 changes: 1 addition & 1 deletion roles/ha-loadbalance/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
# tasks file for ha-loadbalance
- include: keepalived-haproxy.yml
when: keepalived_haproxy_enabled
when: keepalived_haproxy_enabled is defined and keepalived_haproxy_enabled == True
1 change: 1 addition & 0 deletions roles/host-init/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
when: is_system_update
- include: installKubeadm.yml
- include: apiServerDns.yml
when: master_vip is defined
- include: resolv.yml
when: public_network_node == False
- include: publicInterface.yml
Expand Down

0 comments on commit 075c821

Please sign in to comment.