Need help with ansible-install-k8s?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

lizhenliang
160 Stars 168 Forks 54 Commits 1 Opened issues

Services available

!
?

Need anything else?

Contributors list

No Data

Kubernetes v1.18 高可用集群自动部署(离线版)

确保所有节点系统时间一致

1、找一台服务器安装Ansible

yum install epel-release -y
yum install ansible -y

2、下载所需文件

下载Ansible部署文件:

# git clone https://github.com/lizhenliang/ansible-install-k8s
# cd ansible-install-k8s

下载准备好软件包并解压/root目录:

链接:https://pan.baidu.com/s/1EWnJoJjAD3GNqghOwgodWQ 提取码:tlvz ```

tar zxf binary_pkg.tar.gz

### 3、修改Ansible文件

修改hosts文件,根据规划修改对应IP和名称。

vi hosts

... ``` 修改group_vars/all.yml文件,修改软件包目录和证书可信任IP。

# vim group_vars/all.yml
software_dir: '/root/binary_pkg'
...
cert_hosts:
  k8s:
  etcd:

4、一键部署

架构图

单Master架构 avatar

多Master架构 avatar

部署命令

单Master版: ```

ansible-playbook -i hosts single-master-deploy.yml -uroot -k

多Master版:

ansible-playbook -i hosts multi-master-deploy.yml -uroot -k

## 5、部署控制
如果安装某个阶段失败,可针对性测试.

例如:只运行部署插件

ansible-playbook -i hosts single-master-deploy.yml -uroot -k --tags addons

## 6、节点扩容
1)修改hosts,添加新节点ip

vi hosts

2)执行部署

ansible-playbook -i hosts add-node.yml -uroot -k

3)在Master节点允许颁发证书并加入集群
kubectl get csr kubectl certificate approve node-csr-xxx ```

视频教程:https://ke.qq.com/course/266656

avatar

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.