目录
- 概述
- 资源
- 安装
- 执行过程
- 集群验证
概述
功能如下:
- ansible 2.9版本离线安装
- centos 7 内核离线升级
- cfssl 离线二进制安装
- etcd 3.5.13版本 二进制离线安装
资源
相关前置资源如下
资源 | 地址 |
---|---|
Ansible离线安装 | 地址 |
ansible-playbook离线升级centos内核 | 地址 |
ansible离线部署etcd二进制集群资源下载 | 地址 |
安装
执行过程
[root@hadoop01 k8s-ansible]# ansible-playbook -i hosts test-cert.yml
PLAY [master] **********************************************************************************************************************************************************************
TASK [cert : 1.ansible工作目录] ********************************************************************************************************************************************************
ok: [10.xx.xx.142] => {
"msg": "ansible目录是:/root/k8s-ansible"
}
TASK [cert : 安装 cfssl] *************************************************************************************************************************************************************
[WARNING]: Consider using the file module with mode rather than running 'chmod'. If you need to use command because file is insufficient you can add 'warn: false' to this command
task or set 'command_warnings=False' in ansible.cfg to get rid of this message.
changed: [10.xx.xx.142]
TASK [cert : 验证] *******************************************************************************************************************************************************************
changed: [10.xx.xx.142]
TASK [cert : 打印cfssl验证信息] **********************************************************************************************************************************************************
ok: [10.xx.xx.142] => {
"msg": "/usr/local/bin/cfssl"
}
TASK [cert : 创建目录 pki] *************************************************************************************************************************************************************
changed: [10.xx.xx.142]
TASK [cert : 创建 CA config] *********************************************************************************************************************************************************
changed: [10.xx.xx.142] => (item=kubernetes)
TASK [cert : 创建 CA CSR] ************************************************************************************************************************************************************
changed: [10.xx.xx.142] => (item=kubernetes)
TASK [cert : Create etcd-ca.pem] ***************************************************************************************************************************************************
changed: [10.xx.xx.142]
TASK [cert : Create etcd-server CSR] ***********************************************************************************************************************************************
changed: [10.xx..142] => (item=10.xx.xx.142)
ok: [10.xx.xx.142] => (item=10.xx.xx.143)
ok: [10.xx.xx.142] => (item=10.xx.xx.144)
TASK [cert : Create etcd-ca.pem] ***************************************************************************************************************************************************
changed: [10.xx.xx.142]
PLAY RECAP *************************************************************************************************************************************************************************
10.xx.xx.142 : ok=10 changed=8 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[root@hadoop01 k8s-ansible]# ansible-playbook -i hosts test-etcd.yml
PLAY [etcd] ************************************************************************************************************************************************************************
TASK [创建etcd相关目录] ******************************************************************************************************************************************************************
ok: [10.xx.xx.143] => (item=/etc/etcd)
ok: [10.xx.xx.142] => (item=/etc/etcd)
ok: [10.xx.xx.144] => (item=/etc/etcd)
ok: [10.xx.xx.143] => (item=/etc/etcd/ssl)
ok: [10.xx.xx.144] => (item=/etc/etcd/ssl)
ok: [10.xx.xx.142] => (item=/etc/etcd/ssl)
ok: [10.xx.xx.143] => (item=/var/lib/etcd)
ok: [10.xx.xx.144] => (item=/var/lib/etcd)
ok: [10.xx.xx.142] => (item=/var/lib/etcd)
TASK [etcd : 同步所有机器的pki证书] *********************************************************************************************************************************************************
changed: [10.xx.xx.142]
changed: [10.xx.xx.144]
changed: [10.xx.xx.143]
TASK [etcd : 分发ssl证书01] ************************************************************************************************************************************************************
changed: [10.xx.xx.143]
changed: [10.xx.xx.144]
changed: [10.xx.xx.142]
TASK [Copy etcd.service] ***********************************************************************************************************************************************************
changed: [10.xx.xx.142]
changed: [10.xx.xx.144]
changed: [10.xx.xx.143]
TASK [分发etcd] **********************************************************************************************************************************************************************
changed: [10.xx.xx.142]
ok: [10.xx.xx.143]
ok: [10.xx.xx.144]
TASK [解压etcd] **********************************************************************************************************************************************************************
[WARNING]: Consider using the file module with state=absent rather than running 'rm'. If you need to use command because file is insufficient you can add 'warn: false' to this
command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.
changed: [10.xx.xx.144]
changed: [10.xx.xx.142]
changed: [10.xx.xx.143]
TASK [Copy etcd config] ************************************************************************************************************************************************************
changed: [10.xx.xx.143]
changed: [10.xx.xx.144]
changed: [10.xx.xx.142]
TASK [enable etcd.service] *********************************************************************************************************************************************************
ok: [10.xx.xx.144]
ok: [10.xx.xx.143]
ok: [10.xx.xx.142]
PLAY RECAP *************************************************************************************************************************************************************************
10.xx.xx.142 : ok=8 changed=6 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
10.xx.xx.143 : ok=8 changed=5 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
10.xx.xx.144 : ok=8 changed=5 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
集群验证